API reference
API reference
Select your platform
No SDKs available
No versions available

PlayerLocomotor Class

Extends MonoBehaviour, ILocomotionEventHandler
Moves a player when receiving events from ILocomotionEventBroadcasters.
The movement can be a combination of translations and rotations and it happens at the very end of the frame (after rendering).
This is a simplistic implementation of ILocomotionEventHandler which moves player by actuating the transforms directly, which is useful for reference but may interfere with more sophisticated player control mechanisms. For alternatives specialized to specific player controls, see CapsuleLocomotionHandler, FirstPersonLocomotor, and FlyingLocomotor.

Properties

Signal indicating a LocomotionEvent has been handled, including the event itself and the new player pose resultant from the handling of that event.
Because this signal is on a per-event basis, this can be invoked multiple times in the same frame.

Protected Fields

bool _started[Get]

Protected Functions

virtual void Start ( )

Member Functions

Consumes a LocomotionEvent, canonically directly from an ILocomotionEventBroadcaster.
This event is not acted upon immediately, but is cached for consumption at the end of the frame when PlayerLocomotor processes all incoming events at once.
Parameters
locomotionEvent
The event to be handled
Injects all required dependencies for a dynamically instantiated PlayerLocomotor; effectively wraps InjectPlayerOrigin(Transform) and InjectPlayerHead(Transform).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the player's origin transform for a dynamically instantiated PlayerLocomotor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the player's head transform for a dynamically instantiated PlayerLocomotor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Did you find this page helpful?