Spatial is a metaverse platform that allows anyone to create immersive 3D spaces, which can be instantly shared to the Web, iOS, Android, and VR, and explored by others. The Spatial Creator Toolkit, powered by Unity, allows you to add even more interactivity to the experience, without needing to code. This tutorial will guide you through the process of creating and uploading your first Spatial experience using the Creator Toolkit on Unity.
Before we get started:
- Create an account with Spatial
- Install Unity version 2021.3.21 and install the “WebGL Build Support” module with it. If you don’t yet have Unity Hub installed, you will need to install it first
- Download the Spatial Unity Starter Template
- Download this 3D golf ball in .obj file format
- Download this Monstarlab Badge
Start by opening the Spatial Starter template project in Unity. You will be prompted to update to the latest Spatial SDK. Click 'yes' and allow the project to load. We will need to configure our Spatial credentials first. Click on the 'Spatial SDK' tab in the header > Account. This will open the Spatial Portal window (which we will keep coming back to).
Click on "Get Login Token", which will redirect you to your browser where you can copy your token directly to your clipboard. Once you copy it, come back to Unity and click on "Paste Login Token". Now you should be ready and set up to start working!
" and drag this prefab directly into your scene. Set its position in the Transform component to (X: 522, Y: 4.48, Z: 654). If this is your first time using Unity, you can read here to learn how to navigate the scene view.
If you look at the 'Spatial Trigger Event' component, you can see a few things that will happen when the player walks into the radius of this object.
' game object. Scale and position it so it's roughly at the same size and position as the coin.
Make sure to switch out the coin for the golf ball in the 'On Trigger Event', so the new 3D model is disabled when collected.
. In the Spatial Portal > Config tab, select 'Create New World'and then select 'Publish'. You'll receive an email once your space is successfully published. After that, we can set up a badge in Spatial Studio.
Select your world, and then select Badges > + New Badge. Here, you can upload the Monstarlab badge that you downloaded at the start of this blog (or feel free to create your own!). Give your badge a name and description.
![Badge Description](/assets/img/articles/2023-09-06-How-to-create-an-Interactive-Experience-using-the-Spatial-Creator-Toolkit/Badge.webp
Now you can return to Unity, and go back to your Quest object. Add a 'Quest Reward' and select 'Badge'. Copy and paste the 'Id' from your badge in Spatial Studio.
![Badge ID](/assets/img/articles/2023-09-06-How-to-create-an-Interactive-Experience-using-the-Spatial-Creator-Toolkit/BadgeID.webp
And there you go! Run the scene again, collect all the golf balls, and you should be rewarded with a badge when you're done! 🙂
![Reward](/assets/img/articles/2023-09-06-How-to-create-an-Interactive-Experience-using-the-Spatial-Creator-Toolkit/End.webp
Useful resources
Article Photo by Spatial
Spatial Unity Starter Template by Spatial