Unity to ios

Unity to ios DEFAULT

Export from Unity to an iOS Device

One of the first things I had to look into when I started developing my iOS game was how to export to the device so as to be able to test the game. Initially the process seemed long and complex and the main issue I had was that although the resources where all out there, they were not all in one place and so I had to mix and match from various tutorials. Here I will therefore summarize the process step by step in a single post. This is the process I followed to set everything up and has worked fine for me thus far; so hopefully it will be of assistance to people in a similar stage of development.

Here we go…

1. Get Unity and the IOS exporter

If you haven’t done this already you first need to download the latest version of Unity via the official website. There are two versions available, the free (http://unity3d.com/unity/download) and the Pro version (https://store.unity3d.com/), so you can choose one according to your needs. Since May 2013, the mobile exporters come with and you no longer have to pay for them.

2. Register for the Apple Developers program

The next thing that you will have to do is join the Apple developers’ program which is essential for setting up your development certificates among other things. Joining the program will cost $99 per year and you will need to register via the developers website here: https://developer.apple.com/programs/ios/ (Once you have registered and payed your fee, you will receive an activation e-mail which will allow you to fully join the program and give you access to all the features that you need).

3. Download and install XCode

Having joined the developers program the next thing to do is download and install XCode. This may seem confusing at first, as some of you will know that XCode is used for building native apps for the IOS. What happens is that Unity uses XCode as a mediator to push things into the IOS device, so you will not be actually working in XCode, all of the development will happen in Unity, however XCode is needed for exporting from Unity to the device. You can download XCode from https://developer.apple.com/xcode/ from the Apple Store. When done, make sure to install it before continuing.

4. Create a Developer Provisioning Profile

So far you should have downloaded Unity and XCode and activated your Apple developer program membership. Now, to export your game directly from Unity to the device you will need a Developer Provisioning Profile (which will authorize you to port the game you have developed or any tests, to your device). Apple offers two types of signed profiles, the Developer Profile, used for developing and testing (the one discussed here) and the Distribution Profile, used for submitting to the Apple Store (which is not covered in this post). However to set up the Developer Provisioning Profile you will need three separate things: to register your device / to set an App ID / and to get a Certificate.

All three can happen via your Apple Developer profile. So navigate to this address: https://developer.apple.com/ and then from the top menu go to Member Center. Use your Apple ID and Password to log in and then you will see a screen similar to this one:

1

Now go and select the Certificates, Identifiers and Profiles from where you can access and manage your provisioning profiles, apple IDs etc.

i. Register your Device

When in the Certificates, Identifiers and Profiles section, select Devices. The reason why this is needed is for Apple to be able to identify the specific device which will be used for testing. This will not alter any of your device’s settings and you can easily use the regular device you use everyday. To register your device hit the + button to add a new device. You will then need the device’s Name (which can be anything you want) and the UDID (which is the device’s unique ID). As you’ll see you can register more than one devices for testing, which could be useful if you’d like to test on more than one device (e.g. an iPhone and an iPad).

To find your device’s UDID you will need to connect your device to your computer, then open iTunes and hit the iPhone button (upper right corner of the interface) and you’ll see your device’s info including the name. Then hover over and click on the Serial Number which will change to a long identifier, the UDID.

5

This is the number you need so make sure to copy-paste it in the ID section in the Member Center Portal. Now review and register your device. Remember that once you register the device you can then only change its name and not the UDID.

ii. Set up an App ID

The next step is to set up your App ID. Still in Certificates, Identifiers and Profiles in the Member Center Portal select App IDs and hit the + button.

First provide the Description which can be anything you want as long as it helps you remember what the ID is used for. A good practice is to use a unique name for an app you plan to use and a generic one for a testing app. Next you need to set up the Bundle Identifier which takes the form of a reversed domain notation:

This is: com followed by your full name (if you are an individual developer) and your game’s name:

com.YourName.TheGameName

This type of Bundle ID is an Explicit one and is used for only one game. Therefore you will have to use a different name for every game you make. However it is useful and it allows you to access services like the ‘Game center’ and the ‘In-app purchases’.

On the other hand a Wildcard Bundle ID take the following form:

com.YourName.*

Here the game name is replaced by an asterisk. This format allows you to use one ID for multiple apps, without having to set a different name everytime, however it does not allow you to use certain services.

Now you have made your selections hit continue and confirm the App ID. Take a note of the Bundle ID as you’ll need to use it in Unity’s Build Settings later.

iii. Get a Developer Certificate

The first thing to do to get a Developer Certificate is to get a Certificate Signing Request through your computer. Go to Applications > Utilities > Keychane Access and then Preferences > Certificates. Make sure that both Online Certificate Status Protocol and Certificate Revocation List are OFF and close Preferences. Now in Keychane Access go to the Certificate Assistant and select Request Certificate from Certificate Authority. Provide the same details as the ones you used to register for the developer’s program and hit continue. Provide a name and save to Desktop. If asked choose: 2048 bits and RSA when you save.

You should now have a file with a .certSigningRequest prefix on your Desktop.

Now back Certificates, Identifiers and Profiles in the Member Center Portal, select Certificates > Development (as you are about to get a Development Certificate) and hit the + button to create one.

Choose to upload the Certificate Signing Request you have saved on your Desktop. Before you submit it, make sure to scroll down the page and find the WWDR Certificate  in Intermediate Certificates. Download this as you will need it later!!

4

Now Submit and your Certificate Signing Request will be send to Apple and replaced by another one which you can download. This one is named: ios_development.cer

So now you should have two certificates on your Desktop. The ios_development.cer and the WWDR Certificate  and you need to double-click on both of them to install then in Keychane Access. That’s it, you now have your developer certificate set up and installed.

iv. Create the Provisioning Profile

Having done the above three steps you can now go ahead and create your Provisioning Profile. Still in Certificates, Identifiers and Profiles in the Member Center Portal go to Provisioning Profiles > All and hit the + button to create a new profile.

Choose between a Development and a Distribution Profile (here we need a Development one!) and on the next screen choose the App ID, the device and the certificate associated to this profile (these are the ones you set up on previous steps). Finally name the profile and review the selections. When ready, hit Generate. Your new Provisioning Profile will now be available and you need to download it to your Desktop and install it. The profile will be a file with the prefix: .mobileprovision

Now start XCode and go Window > Organizer > Devices > Provisioning Profile and then double click on the profile downloaded on your desktop. It will be installed and should be visible in the Organizer view. This last step is very important as the profile must be installed into XCode to properly work!


Something Extra: While still in XCode if your device is not visible in the Devices’ view go to Window > Organizer > Devices  and choose a device by name. You may have to select Use for Development in the process, and provide your developer’s log in details.

OK that was a long process but the good news is that you’re done!
You can now start working on your Unity game and be ready to export it once done!

Remember that you register your device and create a developer certificate only once, but you need to create a new App ID and a new Provisioning Profile everytime you make a new game.

5. Working in Unity

When you are ready to export your game, go to File > Build Settings and make sure you select IOS as your platform. Remember also to include the current scene to the exported game (use the Add Current button). Then hit the Player Settings button and go to Other Settings.

Screen Shot 2013-05-21 at 15.16.33

Set the Bundle Identifier to be the one you set up earlier ( com.YourName.TheGameName ) and you may also have to set the Target IOS Version to 6 (or the version your device is using). Leave everything else as default unless you have a reason to change it.

Now back to the Build Settings Window hit Build and save the project on its own folder.

Connect your device to your computer, open the folder and start the xcode project. You’ll see it opening inside XCode. Select your device from the top left corner in the XCode interface and then hit the Run button.

8

The project will be build on your device and run automatically (make sure your device is unlocked!).

run

And there it is! Your game is running on your IOS device.

p.s. the game that you see on the image above is from a great tutorial I found on-line here

-----------------------------------------

Original post: http://mobilegbl.wordpress.com/2013/05/21/from-unity-to-an-ios-device/

Sours: https://www.gamedeveloper.com/programming/export-from-unity-to-an-ios-device

Using this package

This package supports Apple's SKAdNetwork and AppTrackingTransparency frameworks for your made-with-Unity iOS application, by aggregating proper ad network IDs and providing access to relevant Apple developer APIs.

For more information about iOS 14 technical integration, including this package's support functionality, please see the full iOS 14 technical documentation.

Installing the package

From this repository

  1. Download this repo to your hard drive.
  2. In the Unity Editor, open the Unity Package Manager window.
  3. Click the + button and select Add package from disk....
  4. Navigate to the location where you downloaded the repo and select the iOS14 Support package (..\com.unity.ads.ios-support-master\com.unity.ads.ios-support\package.json) to install the package. If successful, the iOS14 Support package will appear in the package manager list (note that you must have All packages selected to view it).

From Unity Package Manager

  1. In the Unity Editor, select Window > Package Manager to open the Package Manager.
  2. Select the Advertisement package from the list, then select the most recent verified version.
  3. Click the Install or Update button.

Apple developer API extensions

This package provides access to the following Apple developer APIs:

This method allows you to update the attribution conversion value.

This method allows you to register for attribution.

This method allows you to request the user permission dialogue.

This method allows you to check the app tracking transparency (ATT) authorization status.

Sample Project

The SampleProject~ folder included here is a complete Unity project, compatible with Unity 2018.4.33f1 and up. This project contains an example of a context screen you could use to give context to users before showing the native App Tracking Transparency dialog.

Sours: https://github.com/Unity-Technologies/com.unity.ads.ios-support
  1. Transparent vinyl sheet
  2. Amana furnace prices
  3. Forum ru board com

Getting Started with the Facebook SDK for Unity on iOS

Configuring your app for iOS

Step 1: Switch to the iOS Platform

Go to the Unity Editor. From the menu, choose 'File', 'Build Settings…' In the Build Settings dialog, under 'Platform', select 'iOS' as the target and click 'Switch Platform'. Ensure the sample project scenes have been added to the 'Scenes in Build' as previously described here.

Unity Build Settings

Step 2: Set minimum iOS Version

The Facebook SDK for Unity only supports iOS version 8.0 and above. In order to prevent issues any issues on older devices, ensure the 'Target minimum iOS Version' is set to or higher.

iOS Player Settings

Step 3: Configure Bundle ID

With the Build Settings dialog still open, click 'Player Settings...' Then, in the Inspector pane go to 'Settings for iOS', then 'Other Settings'. Fill in the 'Bundle Identifier' field with a valid bundle identifier, usually formed using your company name and product name.

iOS Player Settings

Whatever value you put there, you'll need to configure the same value in your app's Facebook settings. Go to the 'iOS' pane in the Basic tab of your app's 'Settings' page, and fill in the 'Bundle ID' field.

iOS Facebook App Settings

Step 4: Build

Now, back in the Unity Editor, click the 'Build' button. When prompted for an output directory name, call it . Once Unity finishes building, open the file in the directory that was created with Xcode.

Project file

Opened in Xcode

You can hit the 'Play' button in Xcode to run the app in your default target (by default, the simulator), or use Xcode's usual functionality to run it on real iOS devices.

Now you're up and running on iOS. Congratulations!

Sours: https://developers.facebook.com/docs/unity/getting-started/ios/

Quickstart: Create a Unity iOS app with Azure Spatial Anchors

This quickstart covers how to create a Unity iOS app using Azure Spatial Anchors. Azure Spatial Anchors is a cross-platform developer service that allows you to create mixed reality experiences using objects that persist their location across devices over time. When you're finished, you'll have an ARKit iOS app built with Unity that can save and recall a spatial anchor.

You'll learn how to:

  • Create a Spatial Anchors account
  • Prepare Unity build settings
  • Configure the Spatial Anchors account identifier and account key
  • Export the Xcode project
  • Deploy and run on an iOS device

If you don't have an Azure subscription, create a free account before you begin.

Prerequisites

To complete this quickstart, make sure you have:

  • A macOS machine with the latest version of Xcode and Unity (LTS) installed. Use Unity 2020 LTS with ASA SDK version 2.9 or later (which uses the Unity XR Plug-in Framework) or Unity 2019 LTS with ASA SDK version 2.8 or earlier.
  • Git installed via HomeBrew. Enter the following command into a single line of the Terminal: . Then, run and .
  • A developer enabled ARKit compatible iOS device.

Create a Spatial Anchors resource

Go to the Azure portal.

On the left pane, select Create a resource.

Use the search box to search for Spatial Anchors.

Screenshot showing the results of a search for Spatial Anchors.

Select Spatial Anchors, and then select Create.

On the Spatial Anchors Account pane, do the following:

  • Enter a unique resource name by using regular alphanumeric characters.

  • Select the subscription that you want to attach the resource to.

  • Create a resource group by selecting Create new. Name it myResourceGroup, and then select OK.

    A resource group is a logical container into which Azure resources, such as web apps, databases, and storage accounts, are deployed and managed. For example, you can choose to delete the entire resource group in one simple step later.

  • Select a location (region) in which to place the resource.

  • Select Create to begin creating the resource.

Screenshot of the Spatial Anchors pane for creating a resource.

After the resource is created, the Azure portal shows that your deployment is complete.

Screenshot showing that the resource deployment is complete.

Select Go to resource. You can now view the resource properties.

Copy the resource's Account ID value into a text editor for later use.

Screenshot of the resource properties pane.

Also copy the resource's Account Domain value into a text editor for later use.

Screenshot showing the resource's account domain value.

Under Settings, select Access Key. Copy the Primary key value, Account Key, into a text editor for later use.

Screenshot of the Keys pane for the account.

Start by preparing your environment for the Azure CLI:

  • Use the Bash environment in Azure Cloud Shell.

    Launch Cloud Shell in a new window

  • If you prefer, install the Azure CLI to run CLI reference commands.

    • If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For additional sign-in options, see Sign in with the Azure CLI.

    • When you're prompted, install Azure CLI extensions on first use. For more information about extensions, see Use extensions with the Azure CLI.

    • Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.

  1. After you sign in, use the az account set command to select the subscription in which to set up the spatial anchors account:

  2. Run the az group create command to create a resource group, or use an existing resource group:

    A resource group is a logical container into which Azure resources, such as web apps, databases, and storage accounts, are deployed and managed. For example, you can choose to delete the entire resource group in one simple step later.

    You can view your current spatial anchors accounts for a resource group by using the az spatial-anchors-account list command:

    You can also view the spatial anchors accounts for your subscription:

  3. Run the az spatial-anchors-account create command to create your spatial anchors account:

  4. View the resource properties by using the az spatial-anchors-account show command:

    Copy the resource Account ID value and the resource Account Domain value into a text editor for later use.

  5. Run the az spatial-anchors-account key show command to get your primary and secondary keys:

    Copy the key values into a text editor for later use.

    If you need to regenerate keys, use the az spatial-anchors-account key renew command:

You can delete an account by using the az spatial-anchors-account delete command:

Start by preparing your environment for Azure PowerShell:

Important

While the Az.MixedReality PowerShell module is in preview, you must install it separately using the cmdlet. After this PowerShell module becomes generally available, it will be part of future Az PowerShell module releases and available by default from within Azure Cloud Shell.

  1. After you sign in, use the Set-AzContext cmdlet to select the subscription in which to set up the spatial anchors account:

  2. Run the New-AzResourceGroup cmdlet to create a resource group, or use an existing resource group:

    A resource group is a logical container into which Azure resources, such as web apps, databases, and storage accounts, are deployed and managed. For example, you can choose to delete the entire resource group in one simple step later.

    You can view your current spatial anchors accounts for a resource group by using the Get-AzSpatialAnchorsAccount cmdlet:

    You can also view the spatial anchors accounts for your subscription:

  3. Run the New-AzSpatialAnchorsAccount cmdlet to create your spatial anchors account:

  4. View the resource properties by using the Get-AzSpatialAnchorsAccount cmdlet:

    Copy the property accountId value and the property accountDomain value into a text editor for later use.

  5. Run the Get-AzSpatialAnchorsAccountKey cmdlet to get your primary and secondary keys:

    Copy the key values into a text editor for later use.

    If you need to regenerate keys, use the New-AzSpatialAnchorsAccountKey cmdlet:

You can delete an account by using the Remove-AzSpatialAnchorsAccount cmdlet:

Download and open the Unity sample project

Clone the samples repository by running the following commands:

Follow the instructions here to download and import the ASA SDK packages required for the iOS platform.

In Unity, open the project in the Unity folder. Unity might prompt you about a difference between the version in the project and the version that's installed on your machine. This warning is okay, as long as your version of Unity Editor is newer than the one that the project was created with. If your version is newer, select Continue. If your version is older than the one the project needs, select Quit, and upgrade your Unity Editor.

Screenshot of the Unity pane.

Open Build Settings by selecting File > Build Settings.

In the Platform section, select iOS.

Select Switch Platform to change the platform to iOS. Unity might prompt you to install iOS support components if they're missing.

Screenshot of the Unity Build Settings window.

Close the Build Settings window.

Configure the account information

The next step is to configure the app to use your account information. You copied the Account Key, Account ID, and Account Domain values to a text editor earlier, in the "Create a Spatial Anchors resource" section.

On the Project pane, go to .

Select SpatialAnchorConfig. On the Inspector pane, enter the as the value for Spatial Anchors Account Key, the as the value for Spatial Anchors Account Id, and the as the value for Spatial Anchors Account Domain.

Export the Xcode project

Open Build Settings by selecting File > Build Settings.

Under Scenes In Build, ensure all the scenes have a check mark next to them.

Select Build. On the pane that opens, select a folder to export the Xcode project to.

When the export is complete, a folder that contains the exported Xcode project appears.

Note

If a window appears with a message asking whether you want to replace or append, we recommend that you select Append, because it's faster. You should select Replace only if you're changing assets in your scene. For example, you might be adding, removing, or changing parent/child relationships, or you might be adding, removing, or changing properties. If you're only making source code changes, Append should be enough.

Open the Xcode project

Now you can open your project in Xcode.

You can either launch Xcode and open the exported project or launch the project in Xcode by running the following command from the location where you exported the project:

Select the root Unity-iPhone node to view the project settings, and then select the General tab.

Under Deployment Info, make sure that the deployment target is set to iOS 11.0.

Select the Signing & Capabilities tab and make sure that Automatically manage signing is enabled. If it's not, enable it, and then reset the build settings by selecting Enable Automatic on the pane that appears.

Deploy the app to your iOS device

Connect the iOS device to the Mac, and set the active scheme to your iOS device.

Screenshot of the My iPhone button for selecting the device.

Select Build and then run the current scheme.

Screenshot of the "Deploy and run" arrow button.

In the app, select BasicDemo using the arrows, then press the Go! button to run the demo. Follow the instructions to place and recall an anchor.

Screenshot 1Screenshot 2Screenshot 3

When finished, stop the app by pressing Stop in Xcode.

Troubleshooting

Rendering issues

When running the app, if you don't see the camera as the background (for instance you instead see a blank, blue or other textures) then you likely need to re-import assets in Unity. Stop the app. From the top menu in Unity, choose Assets -> Re-import all. Then, run the app again.

Clean up resources

In the preceding steps, you created Azure resources in a resource group. If you don't expect to need these resources in the future, you can delete them by deleting the resource group.

From the Azure portal menu or Home page, select Resource groups. Then, on the Resource groups page, select myResourceGroup.

On the myResourceGroup page, make sure that the listed resources are the ones you want to delete.

Select Delete resource group, type myResourceGroup in the text box to confirm, and then select Delete.

Next steps

In this quickstart, you created a Spatial Anchors account. You then configured and deployed an app to save and recall spatial anchors. To learn more about how to improve the app so it can share spatial anchors with other devices, continue to the next tutorial.

Sours: https://docs.microsoft.com/en-us/azure/spatial-anchors/quickstarts/get-started-unity-ios

To ios unity

Beginning Unity 3D for iOS: Part 1/3

Learn how to use Unity to make a simple 3D iOS game!

Learn how to use Unity to make a simple 3D iOS game!

Unity is one of the most popular game engines these days. And for good reason – Unity has a powerful visual editor that makes it very easy to get started, a ton of power and functionality, a great community, attractive pricing, and more!

If you’ve been eager to try out Unity for yourself, look no further than this tutorial! In this tutorial you’ll learn how to create a simple iOS game with Unity – and no prior experience is required! :]

The simple game you’ll create in this tutorial will challenge the player to get to a finish line within a certain time limit while avoiding obstacles along the way.

Along YOUR way, you will be introduced to the Unity development environment and workflow, and learn (or review) the basic concepts of game design.

The tutorial will be split into three parts:

In Part 1, you’ll learn the basics of using Unity by creating a game with a simple player control mechanism. You’ll also learn how to deploy your project on iOS.

In Part 2, you’ll learn how to enhance the player’s movements using pre-built controller objects and some scripts found in the standard packages, how to debug using Unity Remote, and how to customize the scene.

In Part 3, you’ll add gameplay to your project and build on game design concepts that include adding prefabs, timers, menus and sounds to enrich the game experience.

Ready to add a powerful new framework to your skillset? Keep reading on! :]

Getting Started

As you move through this tutorial series, you’ll start to become familiar with the Unity development workflow, which has four basic components:

  1. Assembling your game scene in the Unity Editor.
  2. Scripting using the MonoDevelop Editor.
  3. Remote debugging with Unity Remote.
  4. Publishing to your iOS device through the Unity Editor.

In this first part of the tutorial, you’ll install Unity, learn the basics of the Editor interface, and create a project that introduces you to the basic game concepts.

By the end of Part 1, your game will have a player that is able to move via touch triggers. You’ll also test your project in the Unity Editor and with an iOS device.

This tutorial uses Unity version 4 – so go ahead and download Unity if you don’t have it already.

Unity’s doffers a free 30-day trial of the full version of Unity Pro. This version of Unity will allow you to develop games and build them to run on iOS. Although Unity is available for both Mac and Windows, this tutorial is written based on the Mac environment.

Note: The Unity software package is a fairly hefty one at close to 1GB and, depending on your Internet connection, it might take a while to download. So download the file in advance if you want to get going immediately. :]

Create the Project

Once you’ve downloaded Unity and installed it, launch the Unity application. If this is your first time launching Unity, you will be prompted to activate your copy. Select the option to activate the free 30-day trial of Unity Pro, as shown in the screenshot below:

Unity License Activation

Then you will need to create a Unity account if you do not have one, confirm your e-mail address, and login to your account via the Unity app.

Once you login, you’ll be asked to answer a few questions. You can skip them if you scroll to the very bottom of the list and tap “Not Right Now.” :] And then, finally, you can start using Unity.

At this point you should be presented with the Unity interface with a default project already in place – something like the following:

Unity Starter Project

Discard that project and create a fresh project by selecting File\New Project from the menu. You’ll be presented with the Project Wizard:

Project Wizard

In the Project Wizard, click Set and navigate to the folder where you wish to save your project. Enter DashAndZag for the project name and click Save, then Create Project. (You will be asked whether you want to save the previously open default project, but you can opt not to do so, unless of course you want to save it for some reason…)

Note: The Project Wizard includes some standard packages you can import during the initial project creation. Ignore this for now. You’ll import any packages you need for this tutorial later on.

Unity will close the current project and re-launch with your new project:

Initial Project

Ah, a fresh canvas! But what are all these controls, windows and tabs? Where to start?

Getting to Know UI…

It’s worth taking some time to get real cozy with the Unity Editor interface, so take a look around. The first stop on your tour is the Editor Layout tab in the upper-right corner. Change the view to Wide mode:

Change Layout

Here’s a breakdown of what you see, with the various sections highlighted:

Unity Editor

  • Project View: Your Unity project contains an Assets folder whose contents are shown in this section. This is where the scripts, scenes, prefabs and other Unity objects that you create show up.
  • Hierarchy View: This contains the GameObjects that are in the current scene. Every object that shows up in a Unity game is known as a GameObject. These could be simple objects that you create from the GameObject menu or assets you import. Your initial project will contain one GameObject: the Main Camera.
  • Toolbar: The toolbar allows you to manipulate objects in the Scene View or Game View, to control how your Editor views are displayed and to control the game preview in the Editor.
  • Scene View: This view is where you position your GameObjects to set up your game. The Scene View contains a Scene Gizmo (the thing in the top-right corner with the marked axes) that displays the scene camera’s current orientation.
  • Game View: This is the view of your game from the camera(s) in your game. You’ll be brought to the Game View when you hit the Play button in the toolbar. Alternatively, you can switch between the Game and Scene views using the tabs at the top of the window.
  • Inspector: This provides further details about a selected GameObject. You can then modify the object’s properties such as its size or position, or attach scripts to modify the GameObject’s behavior.

You’ll want to be very comfortable using the toolbar transform tools to position GameObjects and navigate around in the Scene View. So let’s dive into that next.

Getting a Hand

The Hand Tool allows you to manipulate your view of the scene.

Hand Tool

The best way to understand the Hand Tool’s use is to imagine yourself dropped into the 3D scene with many GameObjects. Some objects in front of you are visible, while others that are behind you are not.

You may wish to step back in the scene (zoom out) to see more of the view, move to the left or right to see other objects, or swivel and pan around to see what’s behind you. The Hand Tool can do this for you.

As you start to add more GameObjects, you’ll find yourself using this tool more and more to establish your view in the scene before positioning GameObjects.

To see the Hand Tool in action, first select it (left-most choice on the toolbar), then select the Main Camera from the Hierarchy View (just so you have something to look at in the Scene View). You can then drag the canvas to move around the scene.

To zoom, you can use your mouse wheel or hold down Control and drag. You can rotate by holding down option and dragging. If you want to reset your view at any time, you can click on one of the axes on the Scene Gizmo in the upper right.

Hand Tool

Play around with the hand tool a bit and get comfortable with moving around and using the Control and Option combinations to zoom/rotate.

You’ll be switching between the hand tool and other tools a lot, so it helps to remember its shortcut keys. By default, the keys are bound to the keys on the upper left of your keyboard – Q, W, E, and R for Hand, Move, Rotate, and Scale, respectively.

Note: The Hand Tool does not move objects. It only alters your view of the scene, so it may appear as if the objects are moving. Practice moving around the scene using the various Hand Tool options.

Move It Or Lose It

With the Move Tool, you can move GameObjects in 3D space.

Move Tool

Select the Main Camera (double-click it in the Hierarchy View if you don’t see it in the Scene View) and click on the Move Tool. You should see a gizmo around the Main Camera with arrows representing the three axes. These point to where you can move the object:

Move Gizmo

The red arrow represents the x-axis, the green arrow the y-axis, and the blue the z-axis. You can translate or move a GameObject by first selecting the object, left-clicking, and then dragging inside the gizmo (the cube portion).

Select the Main Camera and move it around. Take a look at the Inspector’s transform component. The Position section has x, y, and z values representing the GameObject’s position. As you move the object around, notice that these values change.

Transform Component in Unity

You can change a GameObject’s transform position using either the Move Tool or by typing the position you want directly into these fields.

If you wish to move a GameObject in only one direction, select the relevant axis in the gizmo, left-click and drag that axis. Test this with the Main Camera object by moving in only the x direction and checking that only the x-position value changes in the Inspector. Repeat the same test with the y and z axes.

Inspector after X axis movement

At this point you know how to move your personal view of the scene around, as well as how to move objects around. So far so good!

You Spin Me Right Round

The Rotate Tool allows you to rotate GameObjects in 3D space.

Rotate Tool

To understand the Rotate Tool and how to use it, it’s useful to discuss the Scene Gizmo in more detail. The Scene Gizmo is found on the top-right of the Scene View and has different modes for different views.

One mode (shown in the below right image) is the free-form view that enables you to view your scene in a 3D perspective. This is useful if you want to get a better representation of what your game looks like in 3D space.

You can click on the text under the gizmo to switch to an isometric view (shown in the below left image). This mode is useful in visualizing a GameObject when it’s being rotated.

Scene Gizmo - Perspective View

Another mode is the x-axis view, which enables you to view your scene as if you’re looking down the x-axis. This is useful if you want to move a GameObject along either the y- or z-axis while keeping the x-axis unchanged:

Scene Gizmo - X View

In a similar fashion, you have the y- and z-axis view modes to enable the view of the scene from those respective axes:

Scene Gizmo - Y View

Scene Gizmo - Z View

Select the Main Camera. Switch to the free-form perspective mode by right-clicking on the gizmo and selecting Free.

Switch to Free Form View

Then click on the text below the gizmo to switch between the isometric and perspective modes. Click on the x-, y-, and z-axis modes in turn to see how the Scene Gizmo and Scene View change.

Select the free-form view once more to test out rotation. With the Main Camera still selected, click the Rotate Tool. You should see a gizmo around the Main Camera containing circles with colors representing the three rotation axes:

Rotate Gizmo

Left-click in the center of the Main Camera and use your mouse to drag-rotate it around. Note that the Inspector’s Transform\Rotation properties change as you rotate the object. Note that you can manually edit these values in the Inspector if you’d like.

By clicking in the center of the Main Camera during rotation, you are doing a free-form rotation around all axes. You can also rotate the GameObject around one axis by clicking on one of the colored circles representing that axis. For example, to rotate only around the x-axis, click the red circle to select it, then hold and drag to rotate the object. Repeat the same process to rotate around just the y or z axis.

It All Comes Down to Point of View

Another key concept worth learning at this point is the difference between the local and global (or world) view.

Toolbar - Global

Toolbar - Local

Reset the Main Camera’s rotation to 0,0,0 through the Inspector\Transform\Rotation fields. Click the button so the toolbar says “Local”. Then select the Move Tool so you can see the Scene Gizmo:

Global and Local Aligned

Notice that the Scene Gizmo and the Main Camera’s Gizmo line up, in the sense that the x-axes point in the same direction, as do the y- and z-axes. Now rotate the Main Camera around on the z-axis using the Inspector by setting the Transform\Rotation value to 0,0,-20.

Global and Local Alignment after Rotation.

Notice that the Main Camera’s Gizmo is now rotated around the z-axis – this represents the axis of the object in its local coordinates. This is different compared to the Scene Gizmo, which shows the global space orientation. Switch to Global view to see the difference.

Later in the tutorial, you’ll learn about moving GameObjects and find that it matters which space (world or local) you specify for the movement to use.

Taking a look at the rotated Main Camera, if you were to now move it in the x-direction based on its local space view, it would end up in a different place than if you were to move it in the x-direction based on the global space orientation. Keep that nugget tucked in your mind for later use!

Before you move on, reset the rotation to 0,0,0 to get back to a clean slate.

Scale Tool

The Scale Tool allows you to, you guessed it, scale GameObjects up or down in size.

Using the Scale Tool

As with the other GameObject manipulation tools, you can make your changes along only one of the three axes, and you have the choice of modifying the Inspector\Transform component instead of using the tool.

Select the Main Camera and note that the Scale Gizmo consists of cube handles at the end of each axis and one at the center.

To scale freely across all axes, select the cube at the center of the object and left-click, then move up to make the GameObject bigger and move down to make it smaller. Take a look at the Inspector\Transform\Scale properties. You should see the numbers go up or down as you grow or shrink the object.

Scale Component in Unity

Test scaling along the x-axis by selecting the red gizmo handle for the x-axis, and holding and then moving the handle outward. Verify using the Inspector that the Transform\Scale x-value is the only one that changes. Try this with the y and z axes as well.

Once you’re done playing around with the controls, reset the Main Camera to the following settings using the Inspector\Transform section:

  • Position: 0,1,-10
  • Rotation: 0,0,0
  • Scale: 1,1,1

Your Transform menu should look like this:

After transform properties reset.

You will learn about the other Editor interface components as you walk through the tutorial. This includes previewing a game using the Play button and using the Unity debugger.

Lonely No More: Adding GameObjects

Now that you’ve run through the basic concepts, you’re ready to begin adding GameObjects to keep the camera company – it’s been pretty lonely all by itself :]

Right now the camera is looking out on a very desolate world. Never fear – get ready to add a cube GameObject that represents the player, as well as a plane GameObject that represents the floor the player will move upon.

When you’re designing a game with Unity, a best practice is to first develop the gameplay without any fancy assets that represent the player. That way, you can concentrate on optimizing gameplay and player movements without being distracted by graphics.

Another point to note is that Unity is a very good game engine, but you don’t want to use it to create graphic assets. There are many tools out there that are wonderful in the graphics department and Unity is adept at importing assets from a wide range of tools.

Often, the typical division of game development labor is that the game developer works on the gameplay using Unity while the graphics designer creates assets in parallel using their favorite graphics tool. The two converge down the line when it makes sense to bring in the graphical assets to polish up the game.

Now that you’ve got that to think about, let’s get shaking! Add the floor GameObject, represented by a plane, by selecting Game Object\Create Other\Plane.

The new plane GameObject should appear in the Hierarchy View. Select the plane in the Hierarchy View and set Transform\Position to 0,0,0 using the Inspector. Also use the Inspector to scale it up to 50,1,50. Your scene should look something like this:

Adding plane GameObject.

Next you’ll add the player GameObject, which in your game will be represented by a cube. That’s right, the Heroic Cube!

Select Game Object\Create Other\Cube, and the new cube GameObject should appear in the Hierarchy View. Select the cube in the Hierarchy View and set the Transform\Position to 0,0,0 using the Inspector. Your scene should look like this:

Adding Cube GameObject.

Click on the Move Tool, then click the y-axis in the Scene Gizmo to constrain the object’s move to only the y-axis. Move the Heroic Cube up a little so it’s above the plane (floor). You can also set the transform position to 0,1,0 to move the Cube up a little.

Now comes an exciting moment – click the Play button on the Unity Editor toolbar (at the top) to preview your game thus far:

Play game.

You’re now testing your game using the Unity Editor. The Editor should switch to the Game View and you should see something like this:

Initial game view.

What you’re seeing is a view of the game through the Main Camera in your scene. Your player, the Heroic Cube, is shown in the distance, above the floor – alone in the world, but bravely present!

There’s not much going on in the game because you haven’t added any components to modify the player’s behavior. It’s also a little dark in this scene. You can take care of the latter issue first by adding a light source to your scene.

Stop the game preview by clicking on the Play button again. Back in the Scene View, add a light source. Select Game Object\Create Other\Point Light. As usual, move the light to the origin before making further adjustments to its position. Set the transform position to 0,0,0 using the Inspector.

Now adjust the light’s height and brightness so you can see more of the scene. Here’s a hint: use the Move Tool and constrain movement along the y-axis only.

To adjust the brightness, modify the Range and Intensity settings in the Light component. Make use of the Hand Tool to swivel around if you need to get a better view of the scene.

A good way to see if you have enough light is to switch to the Game View using the Game tab (rather than hitting the Play button). Go back and forth until it looks like you can see your player:

Adding point light GameObject.

After you’ve made your adjustments, hit the Play button again to verify your changes. Your view should be similar to the following when you switch to the Game View:

Game after light source added.

Congrats, you’ve added all the GameObjects you need for this stage of the tutorial! Remember, as a good practice you are focusing on gameplay first, then adding graphics later.

Since you’ve done something meaningful, go ahead and save your work as a scene in the project. A project can be made up of one or more scenes. You can think of a scene as the equivalent of a level in a game.

In this tutorial, you’ll represent each part of the tutorial as a scene. This is an artificial concept of a game level, but it allows you to reuse assets from one scene in the next.

To save the scene, select File\Save Scene and in the Save Scene dialog, name your scene Level_1. Your Project View should update with the scene you’ve just created.

Level 1

Get Moving: Event Functions

The game is currently way too static! It’s in dire need of movement to make it come alive.

You can add movement by creating your own scripts or using pre-packaged scripts that you attach to the relevant GameObject to perform an action. For example, in Part 1 of this tutorial, you’ll create a script that moves the player when touched. The script you create needs to respond to touch events to change the Heroic Cube’s position and rotation.

Unity supports these languages for scripting: JavaScript, C#, and Boo. In this tutorial you’ll be using JavaScript. Unity’s scripting language includes pre-defined event functions that you can use to help define the GameObject’s behavior.

  • The event function that you’ll use the most is the Update() function. If you define this function in your script, it will be called once per frame. Your game display is drawn once per frame and the Update function will therefore be responsible for the display during a particular frame.

    A game runs at a certain amount of frames per second and one thing to keep in mind is that this rate may vary depending on the Platform on which the game is being run, and on how tied up the OS resources are by other applications. This means you shouldn’t do anything very time intensive here, and you can’t assume that it is called at any particular rate.

  • Another pre-defined event function, FixedUpdate(), is called at a fixed rate independent of the frame rate. If your script defines this method it will be called at a fixed interval (in comparison to the Update method which can vary quite a bit from call to call).

    You’ll want to process any physics-related work inside of a FixedUpdate() function, since physics work is very time sensitive. For example, you may have a GameObject that uses physics, such as RigidBody (you’ll learn more about this later). When this object collides with another object you may want to calculate the force to apply to the object, and you should do it in a FixedUpdate() function.

    For operations like changing an object’s transform position or rotation, it’s perfectly fine to do this inside of an Update() function.

  • A third useful function is Start(), called before the first frame update happens. You’ll typically put initialization operations here.
  • Finally, the Awake() function is called when the game begins. It’s another good place to put initialization code.

The Right Touch

Let’s try this out. Create a new script by selecting Assets\Create\Javascript. A new script with the default name NewBehaviorScript should show up in your Project View. Click inside the script’s name in the Project View and rename it to MoveSimple.

Double-click on the script to open it. It should open in the bundled MonoDevelop Unity Editor and should contain the following code:

#pragma strict function Start () { } function Update () { }

The Start() and Update() functions have been stubbed out for you, as they are commonly used event functions. You won’t be needing the Start() function, so remove it. Add the following variables that you’ll use to control the Heroic Cube’s movement and rotation speed below the #pragma line:

var speed : float = 3.0; var rotateSpeed : float = 10.0;

Replace the empty Update() function with the following:

function Update () { // Detect mouse left clicks if (Input.GetMouseButtonDown(0)) { // Check if the GameObject is clicked by casting a // Ray from the main camera to the touched position. var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition); var hit : RaycastHit; // Cast a ray of distance 100, and check if this // collider is hit. if (collider.Raycast (ray, hit, 100.0)) { // Log a debug message Debug.Log("Moving the target"); // Move the target forward transform.Translate(Vector3.forward * speed); // Rotate the target along the y-axis transform.Rotate(Vector3.up * rotateSpeed); } else { // Clear the debug message Debug.Log(""); } } }

Save your changes.

This code first looks for mouse click events, specifically from the left mouse button. A parameter of “0” signifies a left-click, “1” a right-click and “2” a middle-click when used with the GetMouseButtonDown function. If a click is detected, then the code constructs a ray (think of a laser pointer) from the Main Camera to the mouse click position.

The collider.Raycast() function detects if the collider attached to this script is hit by the ray. If the collider is hit, the collider.Raycast() call returns true. The function call takes in three arguments:

  1. The ray you constructed.
  2. A RaycastHit object, which will contain more details if the collider is hit.
  3. A ray length argument.

Assuming a true result, the follow-on code then nudges the player forward based on the speed variable, as well as rotates the player based on the rotateSpeed variable. The transform.Translate() function moves the GameObject transform in the direction and distance specified by its Vector3 input.

Vector3 is a 3D vector representation of an object that has direction and a length or magnitude. The vector can be broken down into x, y and z components.

In the code, your Heroic Cube is moved in the forward direction at a distance multiplier calculated based on the speed variable. Vector3.forward is the same as Vector3(0,0,1) and a speed multiplier of 3 will move the Cube by Vector3(0,0,3).

The direction in which the player moves is relative to the player’s local space. To get a sense of this direction, select the Cube, then the Move Tool and view the z-axis direction. That’s the direction in which the player will move.

The transform.Rotate() function rotates the GameObject transform based on an angle specified by the Vector3 input. Euler angles are used to describe the orientation of a GameObject. In the case of a rotation, the object will be moved Euler angles z degrees around the z-axis, Euler angles x degrees around the x-axis, and finally Euler angles y degrees around the y-axis.

In the code above, the player is being rotated using Vector3.up or Vector(0,1,0), which represents movement around the y-axis. The rotation angle is multiplied by rotateSpeed. The rotation is relative to the player’s local space. So your Heroic Cube will rotate around its y-axis, which, as you know, could differ from the global y-axis.

Note: A real game would never control a player using these types of movements. They are used here simply to illustrate the basic concepts involved in moving GameObjects and will be replaced with more realistic movements in the upcoming parts of the tutorial.

The code contains two Debug.Log() statements. The log output is printed in the Unity console when the game is running. You can see the last log output at the bottom of the Unity Editor. You can also open up the console by selecting Window\Console to see previous log output, as well as clear the logging.

You’ll want to keep an eye on log output at the bottom of the Unity Editor, as that’s where any script errors you have are displayed.

Now that you’ve defined a behavior via code, you can assign it to a GameObject. Select the Cube in the Hierarchy View, then select Component\Scripts\Move Simple. This step is called adding a script behavior to a GameObject and you are simply selecting the script (named MoveSimple) that you already created.

After Move Script added.

Notice that the Inspector now contains a Move Simple script section. The public variables you defined in code, speed and rotateSpeed, are visible in the Inspector View. You can now modify these public variables for just the attached GameObjects without changing the underlying script.

This means if you had two players in the scene with the MoveSimple script attached to them, you could make one player move faster than the other by increasing the speed value via the Inspector\Move Simple\Speed field.

Click Play to preview the game. Touch the player one tap at a time and pay attention to the changes in the transform position and rotation properties in the Inspector.

Game view and transform position changes.

Notice that the transform position that started at 0,1,0 has changed to 0,1,3 – in other words, there’s been a translation movement in the z direction of 3 due to the speed multiplier. The rotation has also changed from 1,1,1 to approximately 1,10,1, which closely matches the rotateSpeed multiplier.

While the game is running, you can change the speed and rotate speed variables in the Inspector. Increase the speed and watch the transform position after clicking on the player.

Stop the game and notice that the speed and rotate speed variables are reset to their original values. Any changes you make while playing the game are temporary. This allows you to tinker around with various settings and come back to the original settings when you’ve completed your preview. If you then want to make lasting changes, you can do so before testing the game again.

Note that as you play the game, the console logs the correct debug statement, depending on whether or not the player is clicked.

Get It All On Camera

You’ll likely have noticed that as you move the Heroic Cube, it moves further and further away from the camera – not a good feeling. Like a well-meaning parent with an ambitious toddler, you’ll modify your game to have the Main Camera track the player at a fixed position from behind. This is typical modus operandi for third-person shooter games.

Select Assets\Import Package\Scripts and in the Items to Import section, choose only the SmoothFollow script and click Import:

Importing the Smooth Follow script.

Note: If you don’t get the import selection dialog when you select Assets\Import Package\Scripts, then try quitting Unity and restarting. That worked for me. :]

A new Standard Assets folder should show up in your Project View. If you navigate through its subfolders you should eventually see a SmoothFollow script. Double-click the script to open it in MonoDevelop so you can look through the key portions of code.

var target : Transform;

The above represents the public variable for the target being tracked. The target’s transform info is used to set the follower’s (or Main Camera’s) position and rotation.

The follower’s position and rotation are set in LateUpdate(), another pre-defined event function. This function is called just after the Update() function completes, and is typically where you would put code that has a dependency on operations that happen in Update().

Once the Heroic Cube’s position and rotation are changed in the Update() defined in the MoveSimple script, the camera can update its own position and rotation in the LateUpdate() of the SmoothFollow script.

.. var wantedRotationAngle = target.eulerAngles.y; // 1 var currentRotationAngle = transform.eulerAngles.y; .. currentRotationAngle = Mathf.LerpAngle (currentRotationAngle, wantedRotationAngle, rotationDamping * Time.deltaTime); .. var currentRotation = Quaternion.Euler (0, currentRotationAngle, 0); .. transform.position = target.position; // 2 transform.position -= currentRotation * Vector3.forward * distance; transform.position.y = currentHeight; .. transform.LookAt (target); // 3 ..

Here are the key points for the above code sections:

  1. Find the angle to which the follower needs to rotate, to match the target rotation. The rotation is around the y-axis.
  2. Move the follower behind the target by an offset corresponding to the distance variable. Also rotate the follower around the y-axis using the results from #1. Finally, make sure that the follower ends up at a fixed height above the target.
  3. Ensure that the follower is always facing the target.

Now attach this script to the Main Camera. Select the Main Camera in the Hierarchy View, then select Component\Camera Control\Smooth Follow:

Smooth Follow script added.

Verify that a new section for Smooth Follow is added to the Main Camera’s Inspector.

Note that the Target variable is unassigned at this point and has None next to it. You’ll want to assign the Cube GameObject to this input. While the Main Camera is still selected and the Smooth Follow script visible in the Inspector, drag the Cube GameObject from the Hierarchy View to the Target variable. Alternatively, you can tap the little circle with a dot in the center next to the Target value to get a list of objects from which to select.

Smooth Follow script target assigned.

The Target variable should now be linked to Cube (the player).

Click the Play button. You should immediately see a change in the view, as you’re now looking down at the player from a given height. Click on the player to move it, and watch how the camera tracks the player. Pay attention to the Main Camera’s transform info in the Inspector and observe it change as the Heroic Cube moves.

Stop the game, and save the scene before moving on to the next step.

Deploying on iOS

If you’re like me, you can’t wait to see how this works on an iOS device. :] The good news is that the trial version of Unity Pro allows you to test your project on iOS!

It’s a best practice to test your Unity projects on an actual device (i.e. not the Simulator). You don’t want to limit your testing to just the Simulator, even though you can do that. Since game development relies so much on the underlying hardware, you want to test on a real device as soon as you can to find any performance issues early.

To deploy to an iOS device, you need to be a registered Apple developer with device deployment capabilities. If you haven’t already, go ahead and fork over the $99 – we’ll be right here waiting for you. :]

Unity can build your game as an Xcode project that you can deploy to an iOS device. To set this up, select File\Build Settings:

Build Settings.

Select the iOS platform and click Switch Platform. Then click on the Player Settings button found at the bottom of the Build Settings dialog. Unity Editor’s Inspector should now display Player Settings that you can customize for your iOS deployment. Make the following changes:

Resolution and Presentation

  • Default Orientation: Landscape Left

iOS Resolution and Presentation settings.

Other Settings

  • Bundle Identifier: the Bundle Identifier needed so that your app can be properly built on your device.
  • SDK Version: Device SDK
  • Target iOS Version: 4.3

iOS Other Settings.

Go back to the Build Settings dialog. Add the scenes that will be part of the iOS build in the Scenes In Build section. Since you only have one scene in your project, this is a no-brainer. Add the Level_1 scene by clicking the Add Current button.

Adding scene to Build Settings.

Click the Build button to initiate the build process. You’ll be asked to specify a location to save the Xcode project. Navigate to where you want to save your Xcode project, enter DashAndZag in the Save As field, and select Save.

Unity will now build the project and open the folder that contains the Xcode version. The project will have the name Unity-iPhone.xcodeproj.

Open the project using Xcode, make sure that the scheme is set to Unity-iPhone, select your device, and build the project.

Xcode project scheme.

Run the app. You should first see a splash screen with the default Unity logo. Then, your game should come up:

Game running on iOS.

Touch the Heroic Cube and watch it move around. You’ve just built and deployed your first Unity project on iOS!

One Finger to Rule Them All

But wait, you’re not done yet!

If you play the game a bit longer, you’ll notice something odd. You can move the Cube by touching it with one finger. However, the Cube will also move when you use two fingers placed at an equal distance from it. What’s going on?

Recall this line of code from your MoveSimple script:

var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);

This casts a ray from the camera to the touch point. The touch point is represented by Input.mousePosition. When running on an iOS device, Input.mousePosition is calculated as an average position of all current touches. Placing your fingers so that the average falls on the player makes the player move!

You should fix this to avoid confusing the user. You can use touch-related functions available in Unity to detect touch events and find the position of a touch more accurately.

Open your MoveSimple script. Add a flag at the top (where the other variables are) that will indicate that you can use touch input:

private var isTouchDevice : boolean = false;

You’re doing this so you can test on both iOS and the Unity Editor. If you’re only going to test on iOS, then you can bypass the touch check logic and simply use the touch-related functions.

Next add an Awake() function that will perform a runtime check to detect if the game is running in an iOS environment. The Awake() function is called only once, when the game is loaded:

function Awake() { if (Application.platform == RuntimePlatform.IPhonePlayer) isTouchDevice = true; else isTouchDevice = false; }

Application.platform returns the platform on which the game is running. RuntimePlatform.IPhonePlayer indicates that the game is running on iOS.

Finally, modify your Update() function as follows to handle touch input:

function Update () { var clickDetected : boolean; var touchPosition : Vector3; // Detect click and calculate touch position if (isTouchDevice) { clickDetected = (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began); touchPosition = Input.GetTouch(0).position; } else { clickDetected = (Input.GetMouseButtonDown(0)); touchPosition = Input.mousePosition; } // Detect clicks if (clickDetected) { // Check if the GameObject is clicked by casting a // Ray from the main camera to the touched position. var ray : Ray = Camera.main.ScreenPointToRay (touchPosition); var hit : RaycastHit; ...

Save your changes.

You are using two new local variables, clickDetected and touchPosition, to detect clicks and save the click position. If running on iOS, you detect the click by checking that a touch has just begun. Then you calculate the click position based on the position of the first touch. If you’re not running on iOS, the logic is the same as before.

Before rebuilding the project, close the Xcode project. Now, rebuild in Unity from the Build Settings dialog. If presented with a warning about the Build folder already existing, select Replace.

Build warning.

Once the Xcode project is rebuilt, open it and run the game on your iOS device. Verify that you’re able to move the Heroic Cube and that the wrinkle allowing you to move it with two fingers is now gone.

Where to Go From Here?

Congratulations, you’ve just finished learning the basics of developing with Unity and deploying on iOS! Here are some downloads with all of the code from the project up until this point: Unity Project, Xcode Project.

In the next part of the tutorial, you’ll build on this rudimentary game by enhancing the Heroic Cube’s movement and improving the scenery. You’ll also do a bit of debugging!

In the meantime, if you have any questions or comments about what you’ve done so far, jump into the conversation in the forums!

Sours: https://www.raywenderlich.com/2804-beginning-unity-3d-for-ios-part-1-3
How To Build a Unity Project To Xcode and iOS device (2018 TUTORIAL)

Screenshots

    Description

    Unity Remote 5, allows you to use an iOS device to view and test your game live, right inside the Unity Editor without having to build your project. Unity Remote 5 makes your iOS device act as remote control. It streams touch, MFi gamepad, Siri remote (on Apple TV) accelerometer, gyroscope, webcam and screen orientation events back to Unity Editor. This is useful for rapid development when you don't want to compile and deploy your project to iOS device for each change and prefer to use the Unity Editor Game window instead. Unity Remote is compatible with any Unity version newer than 5.0, but some features require Unity 5.4 or above.

    Full documentation is available on https://docs.unity3d.com/Manual/UnityRemote5.html

    Amongst the usual bug fixes and performance improvements we've fixed an issue where newer devices weren't using the full screen.

    Ratings and Reviews

    Works well, but some issues

    Ignore the people who give this 1 star reviews. This is a great app! NOTE: For those complaining that it doesn’t work, make sure you have iTunes installed. YOU NEED THIS TO CONNECT IPHONES TO WINDOWS AND MAC (and Linux)

    It would be nice of Unity Technologies to improve the app some more, but it works. The only reason I left a 4 star review is because there are constant crashes even with a good cord and being able to download game.

    If you just made it recover instead of shutting the app off would make it much easier to use. Also maybe download a build onto the app so you can just play it???

    I believe I can say that the people developing would like to download a build to test it with other people and so it doesn’t crash. Just saying...

    Other than that this app is a miracle and I look forward to Unity updating it to make it more usable. Thank you unity!

    Great app for developing

    This is a great app for anyone who wants to develop in Unity for iOS. The only problem I have with it so far is that it doesn’t play audio through the remote, but this is a minor problem. It is more fore development of the visuals and controls. If three is a way to play the audio in the app, I haven’t found it yet, I would give it a 5 star rating if they could add it in.

    Best app ever for game testing without Xcode

    The app works perfectly, first time I had some issues but found out that the wire I was using to connect to my windows computer does not transfer data. After pluging in the new wire the app worked perfectly. The only issue I have is no audio comes through.

    The developer, Unity Technologies ApS, indicated that the app’s privacy practices may include handling of data as described below. For more information, see the developer’s privacy policy.

    Data Not Collected

    The developer does not collect any data from this app.

    Privacy practices may vary, for example, based on the features you use or your age. Learn More

    Information

    Seller
    Unity Technologies ApS

    Size
    42.8 MB

    Category
    Utilities

    Compatibility
    iPhone
    Requires iOS 10.0 or later.
    iPad
    Requires iPadOS 10.0 or later.
    iPod touch
    Requires iOS 10.0 or later.
    Apple TV
    Requires tvOS 9.0 or later.

    Age Rating
    4+

    Copyright
    © Unity Technologies

    Price
    Free

    Supports

    • Family Sharing

      With Family Sharing set up, up to six family members can use this app.

    More By This Developer

    You Might Also Like

    Sours: https://apps.apple.com/us/app/unity-remote-5/id871767552

    Now discussing:

    I loosen up my movements to prolong the pleasure a little bit. But you can't stop at all. I will break off all the buzz for you, and therefore for myself.



    274 275 276 277 278