Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 6

Simulating Your First Scene

Recommended resources

Welcome to the final lesson in our initial project setup module. In the previous lessons, you've successfully configured your Unity project, installed the necessary SDKs, set up a basic VR scene, and learned how to navigate it using the Meta XR Simulator. You have all the pieces in place for development.

This lesson serves as the final, crucial verification step. You will learn how to configure your project's build settings and execute a build for the Meta Quest (Android) platform. While you can't run the final application on a physical device, successfully generating the build file (an APK) is the ultimate confirmation that your entire setup is correct. This process catches configuration errors that in-editor testing might miss, ensuring a solid foundation before we dive into the creative design process.

1. From Editor Play to Standalone Build

So far, you've been testing your scene by pressing the "Play" button in the Unity editor. This is fantastic for rapid iteration. However, this "Play mode" runs the application using your computer's resources and within the editor's environment. It's an emulation, but not a true representation of the final product.

A build is the process of compiling your project into a standalone application that runs on the target device—in our case, a Meta Quest headset. For Android devices, this application is packaged into an .apk file. This process is the definitive test of your project's configuration. It checks for:

  • Correct SDK integration
  • Properly configured platform settings
  • Compatibility of all assets and scripts with the target hardware

Our objective is to go through all the steps to generate this .apk file. Successfully creating it, even without a headset to run it on, proves that your project is ready for development.


2. Configuring the Build Settings for Android

The first step is to tell Unity exactly what to build and for which platform. This is all handled in the Build Settings and Project Settings windows. We'll use a Unity Learn tutorial as our guide, but adapt it to our specific needs.

1.1 - VR Project Setup - Unity Learn

This section of the Unity Learn tutorial covers the exact steps needed to configure a project for an Android build targeting the Quest. We will follow its instructions for setting up the build, but we will execute a "Build" instead of a "Build and Run."

Please open the article and navigate to the section titled 6. Build and run on your device. Follow the instructions in the first two sub-sections: Install the OpenXR for Android builds: Read this part carefully. Go to Edit > Project Settings > XR Plug-in Management and select the Android tab. Ensure the OpenXR plug-in provider is selected, as shown in the article's screenshot. This is what enables VR functionality in your Android build. Resolve warnings by setting up an interaction profile: Follow these steps to resolve any validation warnings. This usually involves clicking a warning icon and adding the Oculus Touch Controller Profile and enabling Meta Quest Support. This step ensures your application knows how to handle input from the Quest controllers. As you follow these steps, you are essentially telling Unity how to package the necessary VR libraries and controller definitions into the final .apk file.

After completing those steps in your Project Settings, we need to prepare the scene itself for building.

  1. Go to File > Build Settings.
  2. At the top, under Scenes In Build, you should see a list. If it's empty, click the Add Open Scenes button. Your current scene (e.g., "SampleScene") will appear in the list with a checkmark.
  3. In the Platform list, ensure that Android is selected. You should see the Unity logo next to it. If it's on another platform (like PC, Mac & Linux Standalone), select Android and click the Switch Platform button. This process may take a few minutes as Unity re-imports assets for the new target.

Your Build Settings window should now have your scene added and the Android platform selected.


3. A Note on Simulators and Building

The Unity Learn article you just read discusses Unity's built-in XR Device Simulator. It mentions adding a prefab to your scene for testing and, crucially, disabling it before building to avoid conflicts.

The Unity XR Device Simulator, which is added as a Prefab to the scene and uses keyboard and mouse for in-editor control.

Our workflow using the Meta XR Simulator is slightly different and, in this case, more streamlined.

The Meta XR Simulator, which is activated from the Unity menu and runs as a separate runtime, avoiding the need for a scene-based prefab.

Because the Meta XR Simulator is activated as an external runtime via the Meta > Activate menu option, there is no GameObject in your scene that you need to remember to disable before building. This cleaner approach prevents potential build issues and is one of the advantages of using the dedicated simulator for our target platform.


4. Executing the Build

Now for the final step. With your build settings configured, you are ready to compile the project.

Return to the Build Settings window (File > Build Settings). At the bottom right, you will see two main options: Build and Build and Run.

  • Build and Run: This option compiles the .apk and then immediately tries to install and launch it on a connected Android device. Since you don't have a device connected, this would result in an error after the build completes.
  • Build: This option simply compiles the .apk and saves it to a location you specify on your computer. This is our goal.

Click the Build button.

A file dialog will open, asking you where to save the .apk file. It's good practice to create a new folder named Builds inside your main project folder. Save the file inside this new folder with a name like MyVRApp_v0.1.apk.

Unity will now begin the build process. This can take several minutes, especially the first time, as it needs to compile all the scripts and package all the assets for the Android platform. You can monitor the progress bar in the bottom right of the editor.

A successful build is one that completes without any red error messages in the Console window. Once it's done, you can navigate to the Builds folder on your computer and see your newly created .apk file. Congratulations! You have just proven that your project is correctly configured for the Meta Quest.


Conclusion

In this lesson, you've bridged the final gap in our project setup. You've learned the critical difference between testing in the editor and creating a standalone build. By navigating the build settings, configuring the Android platform with the correct XR plug-ins, and successfully compiling an .apk file, you have fully validated your development environment.

Key Takeaways:

  • A build creates a standalone application (.apk for Quest) and is the definitive test of a project's configuration.
  • To build for Quest, the platform must be set to Android in Build Settings.
  • The XR Plug-in Management settings for Android must have OpenXR enabled and the Oculus Touch Controller Profile added to support Quest hardware.
  • Clicking Build compiles the project into an .apk file, verifying the setup without needing a physical device to run it.

You have now completed the entire technical setup module. Your project is primed and ready. With this solid foundation, you can confidently shift your focus from technical configuration to creative design.

In the next module, we will leverage your background in UX and interaction design. You will begin by analyzing existing VR productivity apps and then move into Spline to start blocking out the spatial layout and designing the 3D UI components for your own unique application.