TeleporterDestinationDetails - jimdroberts/FishMMO GitHub Wiki
Serializable data structure representing the destination details for a teleporter. Includes the target scene name, position, and rotation for the destination point.
-
public string Scene
The name of the target scene to teleport to.
-
public Vector3 Position
The world position within the target scene where the teleported entity will appear.
-
public Quaternion Rotation
The rotation to apply to the teleported entity at the destination position.
- Use this class as a serializable field or property in a MonoBehaviour or ScriptableObject to define teleporter destinations.
- Assign the
Scene
,Position
, andRotation
fields to specify the teleportation target.
// Example 1: Creating a teleporter destination
TeleporterDestinationDetails destination = new TeleporterDestinationDetails {
Scene = "Castle",
Position = new Vector3(5, 0, 10),
Rotation = Quaternion.Euler(0, 90, 0)
};
// Example 2: Using TeleporterDestinationDetails in a ScriptableObject
[SerializeField]
private TeleporterDestinationDetails destinationDetails;
- Always set valid values for
Scene
,Position
, andRotation
before teleporting entities. - Mark the class as
[Serializable]
to allow Unity to serialize it in the Inspector or ScriptableObjects. - Use descriptive scene names and positions to avoid confusion during development.