Getting Started
Package Types
Scene Setup
Custom Collision, Layers, and Tags
Key Differences from Standard Unity3D development
Economy
Scripting
C# Scripting
Visual Scripting
Sync and Multiplayer
Components
Environment Settings Overrides
Render Pipeline Settings Overrides
Guidelines
Supported Features and Limitations
<aside> <img src="/icons/warning_yellow.svg" alt="/icons/warning_yellow.svg" width="40px" /> This is an experimental component, It is likely to receive large changes in the future!
</aside>
<aside> <img src="/icons/link_blue.svg" alt="/icons/link_blue.svg" width="40px" /> Visual Scripting Implementation
</aside>
<aside> <img src="/icons/book_gray.svg" alt="/icons/book_gray.svg" width="40px" /> Invokes the supplied Events when an avatar enters or exits the trigger respectively. You currently have the choice between Unity Events or Animator events.
</aside>
Property | Function |
---|---|
Listen For | Determines what kind of object will invoke the event when it enters the trigger. |
LocalAvatar: The event will only trigger when the local user enter | |
On Enter | Event that gets invoked when a valid object enters the trigger |
On Exit | Event that gets invoked when a valid object exits the trigger |
Unity Event Is Synced | When checked all clients will execute the Unity Event when the trigger is activated. This has no affect on the Animator event. |
<aside>
<img src="/icons/grid_green.svg" alt="/icons/grid_green.svg" width="40px" /> In order for a Trigger Event to function it must be placed on a GameObject with a collider that has Is Trigger
enabled. You can use any shape collider.
</aside>
<aside>
<img src="/icons/cursor-click_gray.svg" alt="/icons/cursor-click_gray.svg" width="40px" /> You can add functions to the trigger by pressing the +
on the corresponding Unity Event. You can then drag a GameObject into the object field on the left, then choose from any public method available from the dropdown on the right.
In the following video I create a trigger that plays the nearby particle effect when the avatar walks into the cube.
Screen Recording 2022-11-28 at 10.39.44 AM.mov
</aside>
<aside> <img src="/icons/help-alternate_gray.svg" alt="/icons/help-alternate_gray.svg" width="40px" /> Animator events are a feature specific to the SpatialSDK. They let you modify the parameters of an animator, and with the help of the Synced Animator can be synced across clients.
</aside>
<aside> <img src="/icons/add_gray.svg" alt="/icons/add_gray.svg" width="40px" /> Adding an event is similar to a Unity Event, but you have to target an Animator.
Once you have targeted an animator you will be able to choose from any of the parameters on the animator and apply different operations based on the parameter type. In the example below I am setting the bool parameter to true when the trigger is entered.
Screen Recording 2022-11-28 at 10.50.33 AM.mov
If you are not seeing any option to select a parameter make sure that you have some defined in your animator.
</aside>
<aside> <img src="/icons/link_gray.svg" alt="/icons/link_gray.svg" width="40px" /> In order for animator events to be synced across clients the animator being affected must have a Spatial Synced Animator component.
</aside>
← Previous
Next →