Optional
spawn: booleanOptional
spawn: booleanGet a certain component from the object.
The component class to get.
Move to a position (lerps towards).
// Follow the host
host.transform.on("player.move", ev => {
player.transform.move(ev.position.x, ev.position.y);
});
Optional
velocity: Vector2The velocity to display moving at.
Instantly snap to a position without lerping.
// Instantly teleport to wherever the host moves.
host.transform.on("player.move", ev => {
client.me.transform.snapTo(ev.position);
});
The position to snap to.
Optional
rpc: booleanInstantly snap to a position without lerping.
// Instantly teleport to wherever the host moves.
host.transform.on("player.move", ev => {
client.me.transform.snapTo(ev.position.x, ev.position.y);
});
The X position to snap to.
The Y position to snap to.
Optional
rpc: booleanThe dirty state of this component.
Flags for this object, see SpawnFlag.
The net ID of this component.
The previous sequence ID.
The ID of the owner of this component.
The player that this component belongs to.
The current position of the player.
The room that this component belongs to.
The current sequence ID.
The type of object that this component belongs to.
The velocity of the player.
Optional
data: HazelReader | CustomNetworkTransformDataOptional
playerControl: PlayerControl<RoomType>Generated using TypeDoc
Represents player component for networking movement.
See CustomNetworkTransformEvents for events to listen to.