Function
Provides the player's position and rotation as vector values.
The Player Transform Reference node uses the player's head camera as a reference and outputs its current position and rotation. These values can then be used by other nodes to create behaviors that react to the player's movement and orientation. When connected to a Set Value node that updates the player's transform, the player is instantly teleported to the specified position and rotation.
Can be connected to
- Set value node
- Transform node
- Math nodes that support Vector values
- Any node that has input for vector data
Particularities & Node Configuration
- The Player Transform Reference node uses the player's head camera as its reference point.
- The node continuously updates its outputs to reflect the player's current position and rotation.
- The node outputs data only
- The node is synchronized across the network and works in multiplayer.
The Player Transform Reference node provides the following outputs:
- Position
Outputs the current position of the player's head camera as a Vector3 value. - Rotation
Outputs the current rotation of the player's head camera as a Vector3 value.
Using the Player Transform Reference Node
Example: Change the player's position when the simulation starts
In order to recreate this scenario, you'll need the following nodes:
- An On Start Canvas node
- A Player Transform Reference node
- A Vector Value node
- A Set Value node
When the simulation starts, the Player Transform Reference node outputs the player's current position and rotation. The Set Value node then replaces the player's current position with the Vector Value (8, 8, 8).
As a result, the player's position is immediately updated to X: 8, Y: 8, Z: 8 when the simulation begins and the user is teleported to the new position.