Muokkaa

Jaa


Create avatar spawn and travel points

Travel Point Overview

Travel Point is a component in the Mesh toolkit that can be used to define where an attendee's avatar is placed when it joins an Event or where it teleports to, as determined by Visual Scripting, during the Event.

If a Travel Point isn't present in an Environment, and there's a GameObject that represents a floor at the origin, the avatar will be grounded on the floor when the avatar spawns. If no floor is present near the origin, the avatar will spawn above the origin, fall for a little while, and then respawn in a loop.

Travel Point Group Overview

You can have single Travel Points as part of various different GameObjects such as tethers and anchors. If you have a Travel Point GameObject in your scene but no Travel Point Group ...

A screen shot of a Travel Point in the Hierarchy that's not assigned to a Travel Point Group.

... when you enter Play Mode, a Travel Point Group named DefaultTravelGroup will be automatically created and the Travel Point will be assigned to it, though the Travel Point won't appear as a child object to DefaultTravelGroup.

A screen shot of a Travel Point that is automatically assigned to an automatically created Travel Point Group in Play Mode.

Every Travel Point Group must have a unique name.

The Default Spawn Group is the group you want avatars to spawn into when they initially join an event. If you only have one Travel Point Group, it'll be selected as the Default Spawn Group. If you have two or more Travel Point Groups, you can select which you group you want as the Default Spawn Group.

Create a Travel Point Group

  1. Create an empty GameObject and then rename it "Travel Group."

  2. Set Position values of "Travel Group" to 0, 0, 0.

  3. In the Inspector, click the Add Component button.

  4. Search for and then select Travel Point Group.

    A screen shot of a game object with the Travel Point Group component attached.

  5. If you want the group to be the one that avatars spawn into when initially joining an event, make sure Default Spawn Group is selected. Otherwise, make sure it's unselected.

    A screen shot of a Travel Point component with its Default Spawn Group property selected.

Create Travel Points

To add a Travel Point to a Travel Point Group:

  1. Add an empty GameObject as a child of Travel Group, and then rename it to something that shows it'll contain a Travel Point.

    A screen shot of a Travel Point game object created as a child of a Travel Group game object.

  2. In the Inspector, click the Add Component button.

  3. Search for and then select Travel Point.

    A screen shot of the Travel Point component.

Settings

Travel Point component

  • Look At Transform: the point you want the camera to look at after spawning into that transform. This will default to CenterTransform forward.
  • Radius: the size of the travel area. It’s a circle around the center transform.
  • Single Travel: If this is true, only one avatar at a time will spawn into this point unless there are no more points to choose from.

Travel Point Group component

  • Default Spawn Group: When true, this group will be used for finding the default spawn point for an avatar entering a space.

Visual Scripting

  • Travel Point Methods

  • TravelToPoint(): Transport the local avatar directly to a specific Travel Point.

  • Travel Point Group Methods

  • TravelToRandomTravelPoint(): Transport the local avatar to a random point in the group.

Next steps