CharacterRespawnPosition - jimdroberts/FishMMO GitHub Wiki

Description

CharacterRespawnPosition is a MonoBehaviour for FishMMO that marks a character's respawn position in the scene. It draws a gizmo for visualization in the Unity editor, making it easy to identify and adjust respawn points during level design.


API Access

Fields

#if UNITY_EDITOR

  • public Color GizmoColor

    The color used to draw the respawn position gizmo in the editor. #endif

Methods

#if UNITY_EDITOR

  • void OnDrawGizmos()

    Draws a gizmo at the respawn position for visualization in the Unity editor. #endif


Basic Usage

Setup

  1. Attach the CharacterRespawnPosition component to a GameObject in your scene to mark it as a respawn point.
  2. Optionally, adjust the GizmoColor field to customize the gizmo's appearance in the editor.

Example

// Example 1: Adding a respawn position in the Unity Editor
// 1. Add the CharacterRespawnPosition component to a GameObject.
// 2. The respawn position will be visualized with a gizmo in the scene view.

// Example 2: Customizing the gizmo color
characterRespawnPosition.GizmoColor = Color.green;

Best Practices

  • Use this component to clearly mark and visualize all character respawn points in your scenes.
  • Adjust GizmoColor to differentiate between different types of respawn points if needed.
  • Document the purpose and placement of each respawn point for maintainability.
⚠️ **GitHub.com Fallback** ⚠️