Class PlayerSnapToEvent<RoomType>

Emitted when a player snaps to a position, without lerping. Typically emitted when the player is moves between vents.

Type Parameters

Hierarchy

  • BasicEvent
    • PlayerSnapToEvent

Implements

Properties

eventName: "player.snapto"
eventName: "player.snapto"
message: undefined | SnapToMessage

The message that this event originated from.

newPosition: Vector2

The new position of the player.

oldPosition: Vector2

The old position of the player.

player: PlayerData<RoomType>

The player that this event is for.

room: RoomType

The room or client that the event came from.

Accessors

  • get alteredPosition(): Vector2
  • The altered position that the player will snap to instead, if changed.

    Returns Vector2

Constructors

Methods

  • Revert the player's position back to their old position.

    Returns void

  • Set the position that the player was snapped to.

    Parameters

    • position: Vector2

      The position to snap to.

    Returns void

Generated using TypeDoc