Create a blank project

You’ll need Unity installed with Android build support. Read Get started with Unity on Android for help installing Unity, as well as building and deploying to an Android device.

Although the sample application is itself a project, you will still need to create a blank project to import it into.

  1. Open the Unity Hub

  2. Log in (if you are not already)

  3. Select New Project

  4. Select the 3D (URP) Core template

    Image Alt Text:Display URP TemplateFigure 1. URP 3D template

  5. Enter a project name (this will be used as the name of the project folder)

  6. Enter a location (the path of your project on disk)

  7. Select Create Project

Note that Universal Render Pipeline projects are recommended for mobile applications.

Unity will take a moment to create your new project and build the default assets.

Download and install the sample application

Once Unity has loaded, you will be presented with a template project. You can ignore all of the assets provided by Unity; you only need to focus on the files from the sample project.

  1. Open a web browser

  2. Open the sample project page

  3. You will need to log in (if you haven’t already)

  4. On the asset (Optimizing Collisions with Burst and Neon Intrinsics) page, select the Add to my assets button

  5. The button will change to Open in Unity. Select it.

  6. A pop-up window will ask to open the asset in Unity. Select the Open Unity Editor button.

  7. If Unity fails to open the asset or no pop-up appears, select the My Assets button in the top-right of the page:

    a. Your assets should appear in a list

    b. Find the entry for Optimizing Collisions with Burst and Neon Intrinsics

    c. Select the Open in Unity button

    d. A pop-up will appear as in step 6 above

    e. Select Open Unity Editor

  8. The Unity Editor will come to the foreground and display the Package Manager

    Image Alt Text:Open Project managerFigure 2. Package Manager with asset showing.

  9. You will see the sample project listed and highlighted. Select Download.

  10. Select Import

  11. A warning message will appear because the sample project will replace the project settings in your current project. Since this is a newly created project, it is fine to overwrite them. Select Import.

  12. A further warning may appear because the sample project has additional dependencies that your blank project hasn’t activated yet. Select Install/Upgrade.

  13. The Import Unity Package window will appear. It allows individual files and folders to be imported or ignored. You will need all of the files in the project. Leave all items ticked and select Next.

    Image Alt Text:Import sample projectFigure 3. Import the sample project using the Package Manager.

  14. A second window will open listing the project settings that will be overwritten. You want the settings from the sample project, so leave all items ticked and select Import.

    Image Alt Text:Overwrite project settingsFigure 4. Overwrite project settings with the settings from the imported sample project.

Set up the project

Once the sample project has been imported, you will see some errors and warnings.

  1. Open the File menu and select Build Profiles

  2. Select Android from the Platform list

  3. Select Switch Platform, as you did in the previous Learning Path

    Image Alt Text:Build-Profile-MenuFigure 5. Build Profile menu.

Unity will take a moment to build the assets for the Android platform.

The errors will disappear, but some warnings regarding unreachable code may appear. These will be explained later and can be safely ignored for now.

Your Scene view should look something like this:

Image Alt Text:Scene viewFigure 6. Default scene view of the sample project.

If it does not, the next steps should help identify the issue.

Run the project inside the editor

It is worth checking that everything has been imported and built correctly.

  1. Close the Build Profiles window

  2. In the Project tab (usually at the bottom in the default layout), you will see the list of asset files.

    Image Alt Text:Scenes FolderFigure 7. Assets area

  3. Open the BurstNeonCollisions folder

  4. Open the Scenes folder

  5. Open the scene called SampleScene

  6. Select the Play (triangle) button to launch the program.

The game will launch, and you will see an empty environment begin to fill with more and more characters (capsules) over time. It will look something like this:

Image Alt Text:Screenshot at runtimeFigure 8. Sample running in Game view.

Deploy to Android

You will now deploy the sample to your Android device. Your device must already be set up for development. For detailed instructions, read the learning path Get started with Unity on Android .

  1. Open Build Profiles from the File menu

  2. Tick the Development Build option

Image Alt Text:Import sample projectFigure 9. Development Build.

  1. Select Add Open Scenes to add the demo scene to your Scenes in Build list

  2. Plug your Android device into your computer

  3. Once recognized, your device will appear in the drop-down menu next to Run Device

  4. The screenshot above shows the demo device selected as the Run Device. You will see your own device listed here

  5. Select Build and Run

  6. Enter a name for the APK (the Android package) and select Save

Unity will take a moment to build the Android version and then automatically deploy it to your connected Android device. Depending on your setup, the build and deployment process may take several minutes.

This is an example of what the scene could look like on your device:

Image Alt Text:Running on AndroidFigure 10. Sample application running on Android.

Back
Next