TeleporterDestinationDetails - jimdroberts/FishMMO GitHub Wiki

Description

Serializable data structure representing the destination details for a teleporter. Includes the target scene name, position, and rotation for the destination point.


API Access

Fields

  • 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.


Basic Usage

Setup

  1. Use this class as a serializable field or property in a MonoBehaviour or ScriptableObject to define teleporter destinations.
  2. Assign the Scene, Position, and Rotation fields to specify the teleportation target.

Example

// 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;

Best Practices

  • Always set valid values for Scene, Position, and Rotation 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.
⚠️ **GitHub.com Fallback** ⚠️