Core to Spatial is the player avatar. Each player brings their own customized avatar into every space they join. By default every space uses the same avatar controller physics, input, and camera control.
On Spatial each player is their avatar and your space's should be constructed around this. Overwriting or hiding the players avatar should only be done if absolutely necessary.
If your experience requires overwriting the players avatar, such as transforming them into an animal, its best-practice to try contextualizing this inside of your space.
By default players can move around in space's using WASD and move the camera with the mouse. If this is all your space needs then you don't need to configure anything or write any code.
The visual element of an avatar is defined by the Spatial Avatar package. Once you have created an avatar package you can assign it to an avatar using the following.
You can trigger "one-shot" animations on avatars using Avatar Animation packages. Once you have published an avatar animation you can trigger it on the local avatar using PlayEmote.
visibleLocally hides the avatar for the local client. You can set this for any actor’s avatar.
visibleRemotely hides the avatar for everyone. Only available on the localActor’s avatar.
Below is an example of hiding all avatars for the local client.
public void SetAllAvatarsVisibilityLocally(bool visible)
{
foreach (var actor in SpatialBridge.actorService.actors.Values)
{
if (actor != SpatialBridge.actorService.localActor)
{
actor.avatar.visibleLocally = visible;
}
}
}
public void SetAllAvatarsVisibilityLocally(bool visible)
{
foreach (var actor in SpatialBridge.actorService.actors.Values)
{
if (actor != SpatialBridge.actorService.localActor)