IRaptorLocalPlayer
Lets Logic use your own character as the player.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.Components | Raptor.Components | interface | preview, since 0.1.0 |
Implement it on your character and register it with RaptorLocalPlayers.Register. Without it, Logic finds the player by the Player tag or the main camera, and cannot lock its input.
public interface IRaptorLocalPlayerProperties
Eye
Camera Eye { get; }The player's camera, or null if it has none.
Logic reads it whenever it needs the player's view, for example to aim at a button or shake the view.
InputLocked
bool InputLocked { get; set; }Whether the character ignores move, look and jump input. Gravity still applies.
Logic sets it to true while the player is dead or frozen, and back to false afterwards.
Root
Transform Root { get; }The player's root transform. Its position is the feet.
Logic reads it whenever it needs the player's position.
Methods
Teleport
void Teleport(Vector3 feet, float yawDegrees)Moves the player so its feet are at feet, facing yawDegrees. A yaw of 0 faces +Z and 90 faces +X. The player keeps no velocity from before the move.
| Parameter | Type | Description |
|---|---|---|
feet | Vector3 | World position of the feet. |
yawDegrees | float | Facing after the move, in degrees around world up. |
Called on the main thread.
Related types
- RaptorLocalPlayers: Holds the local player that Logic moves, teleports and freezes.