CharacterRespawnPositionDetails - jimdroberts/FishMMO GitHub Wiki

Description

CharacterRespawnPositionDetails is a serializable class for FishMMO that contains position and rotation details for a character's respawn location. It is used to specify where and how a character should be placed when respawning in the game world.


API Access

Fields

  • public Vector3 Position

    The world position where the character will respawn.

  • public Quaternion Rotation

    The rotation to apply to the character at the respawn position.


Basic Usage

Setup

  1. Create a new CharacterRespawnPositionDetails instance and set the Position and Rotation fields as needed.
  2. Use this class to store and retrieve respawn location data for characters.

Example

// Example 1: Creating and configuring respawn position details
CharacterRespawnPositionDetails details = new CharacterRespawnPositionDetails();
details.Position = new Vector3(0, 1, 0);
details.Rotation = Quaternion.identity;

// Example 2: Using respawn details to set a character's transform
character.transform.position = details.Position;
character.transform.rotation = details.Rotation;

Best Practices

  • Use this class to encapsulate all necessary data for character respawn locations.
  • Set both Position and Rotation to ensure correct placement and orientation on respawn.
  • Document the intended use of respawn details for maintainability.
⚠️ **GitHub.com Fallback** ⚠️