CharacterRespawnPositionDetails - jimdroberts/FishMMO GitHub Wiki
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.
-
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.
- Create a new CharacterRespawnPositionDetails instance and set the Position and Rotation fields as needed.
- Use this class to store and retrieve respawn location data for characters.
// 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;
- 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.