TeleporterDestination - jimdroberts/FishMMO GitHub Wiki

Description

Represents a destination point for teleporters in the scene. Used to visually indicate and mark teleporter endpoints in the Unity Editor.


API Access

Fields

  • public Color GizmoColor

    The color used to draw the gizmo for this teleporter destination in the Unity Editor. Defaults to forest green for visibility.

Methods

  • void OnDrawGizmos()

    Draws a gizmo in the editor to visually represent the teleporter destination. If a Collider is attached, draws the collider's gizmo; otherwise, draws a wire cube at the object's position.


Basic Usage

Setup

  1. Attach this script to a GameObject in your scene to mark it as a teleporter destination.
  2. Optionally, add a Collider component to the GameObject for more accurate visualization.
  3. Adjust the GizmoColor field in the Inspector to change the gizmo's color (Editor only).

Example

// Example 1: Marking a teleporter destination in the scene
// Attach TeleporterDestination to a GameObject at the desired location.
// Optionally, add a Collider for custom gizmo visualization.
// Set GizmoColor for editor clarity.

Best Practices

  • Use distinct gizmo colors for different teleporter destinations to avoid confusion in the editor.
  • Add a Collider to the destination GameObject for precise area visualization.
  • Keep destination GameObjects clearly named and organized in the scene hierarchy.
⚠️ **GitHub.com Fallback** ⚠️