Hue Hue Hue Game
The goal of this sample is to re-use assets found within Spatial’s existing samples and create a simple game demonstrating some of the Spatial C# APIs. The premise is simple: start the game and collect as many gems as you can. Collect the gem that matches the selected color and your avatar receives a speed boost.
This sample game demonstrates, in no particular order:
- A game loop
- Using C# events to communicate between game objects
- Organizing your scene hierarchy
- Organizing your project’s assets
- Re-using existing assets
- Using Spatial components to trigger C# code
- Using the Spatial SFX asset
- Using a Virtual Camera
- Custom audio mixer & adjusting a group’s volume
- Using Spatial SDK components: Interactable, Point of Interest, Virtual Camera, Quest
The C# files are full of comments so be sure to peek at them for more information.
How could this sample be improved?
It could be turned into an ACTUAL game with
- New levels
- Obstacles
- Powerups
- Multiplayer capabilities
- The UI could be improved; it uses default Unity UI elements
- Entirely different assets
- Better lighting
- Post-processing
Try it out for yourself
- Download the Unity package
- Import the package into a new project (do not import this into an existing project, just in case you encounter errors)
- Create a project configuration if you’d like to test in your sandbox (or publish), all the necessary files for filling out the project configuration are included
Have fun and let us know what you think in the Discord!
Try it Out
To try out this template:
- Download the code using the View Code button
- Import the package into a new Unity project
- Follow the steps at Creating a Package to set up the configuration for your package type
- Test the package in your sandbox