SkeldJS
    Preparing search index...

    Class PlayerPhysics<RoomType>

    Represents a player object for handling vent entering and exiting.

    See PlayerPhysicsEvents for events to listen to.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    components: NetworkedObject<RoomType, any>[]
    flags: number
    netId: number
    ownerId: number
    pendingDataState: DataState
    player: Player<RoomType>

    The player that this component belongs to.

    room: RoomType
    spawnType: SpawnType
    ventId: number = -1

    The ID of the vent that the player is currently in.

    Accessors

    Methods

    • Exit a vent (Does not have to be the same vent or in the same network as the vent you entered).

      Emits a player.exitvent event.

      Parameters

      • ventId: number

        The ID of the vent to exit.

      Returns void

      client.me.physics.enterVent(PolusVent.Office);
      
    • Visibly pet your pet or another player's pet.

      Unfortunately, due to technical limitations (as SkeldJS doesn't implement various Unity physics/transform mechanics), there is no good way to get the position of the pet except through manual scuffing, which is out of scope of SkeldJS.

      Parameters

      • playerPos: Vector2

        The position of the player while petting.

      • petPos: Vector2

        The position of the pet to pet.

      Returns Promise<void>