logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct UnityCheckpointRespawnPose

    The data a UnityCheckpointTriggerComponent saves with its checkpoint: the world position and rotation a respawn puts the player back at, as UTF-8 JSON. A respawn script loads the checkpoint and reads its data back with TryRead(byte[], out UnityCheckpointRespawnPose).

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Checkpoint.Infrastructure.Components
    Assembly: Serenity.UnityCheckpoint.Infrastructure.dll
    Syntax
    public struct UnityCheckpointRespawnPose

    Constructors

    UnityCheckpointRespawnPose(Vector3, Quaternion)

    Describes where a respawn puts the player back.

    Declaration
    public UnityCheckpointRespawnPose(Vector3 position, Quaternion rotation)
    Parameters
    Type Name Description
    Vector3 position

    The world position.

    Quaternion rotation

    The world rotation.

    Properties

    Position

    The world position a respawn puts the player back at.

    Declaration
    public Vector3 Position { get; }
    Property Value
    Type Description
    Vector3

    Rotation

    The world rotation a respawn puts the player back at.

    Declaration
    public Quaternion Rotation { get; }
    Property Value
    Type Description
    Quaternion

    Methods

    ToBytes()

    The pose as the checkpoint data a checkpoint trigger saves.

    Declaration
    public byte[] ToBytes()
    Returns
    Type Description
    byte[]

    UTF-8 JSON.

    TryRead(byte[], out UnityCheckpointRespawnPose)

    Reads the pose back from checkpoint data a checkpoint trigger saved.

    Declaration
    public static bool TryRead(byte[] data, out UnityCheckpointRespawnPose pose)
    Parameters
    Type Name Description
    byte[] data

    The checkpoint's data.

    UnityCheckpointRespawnPose pose

    The pose, or the default pose when the data is not one.

    Returns
    Type Description
    bool

    True when data holds a whole pose: a position and a rotation. Data a checkpoint trigger did not save — text that is not JSON, bytes that are not text, JSON of another shape, or a pose missing its position or its rotation — answers false instead of a pose at the origin.

    In this article
    © 2026 Serenity. All Rights Reserved