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

PlayerLocomotor Class

Extends MonoBehaviour
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.

Protected Fields

_started : bool
Signature
bool Oculus.Interaction.Locomotion.PlayerLocomotor._started

Properties

WhenLocomotionEventHandled : Action< LocomotionEvent, Pose >
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.
Signature
Action<LocomotionEvent, Pose> Oculus.Interaction.Locomotion.PlayerLocomotor.WhenLocomotionEventHandled

Protected Methods

Start ()
Signature
virtual void Oculus.Interaction.Locomotion.PlayerLocomotor.Start()
Returns
void

Methods

HandleLocomotionEvent ( locomotionEvent )
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.
Signature
void Oculus.Interaction.Locomotion.PlayerLocomotor.HandleLocomotionEvent(LocomotionEvent locomotionEvent)
Parameters
locomotionEvent: LocomotionEvent  The event to be handled
Returns
void
InjectAllPlayerLocomotor ( playerOrigin , playerHead )
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.
Signature
void Oculus.Interaction.Locomotion.PlayerLocomotor.InjectAllPlayerLocomotor(Transform playerOrigin, Transform playerHead)
Parameters
playerOrigin: Transform
playerHead: Transform
Returns
void
InjectPlayerHead ( playerHead )
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.
Signature
void Oculus.Interaction.Locomotion.PlayerLocomotor.InjectPlayerHead(Transform playerHead)
Parameters
playerHead: Transform
Returns
void
InjectPlayerOrigin ( playerOrigin )
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.
Signature
void Oculus.Interaction.Locomotion.PlayerLocomotor.InjectPlayerOrigin(Transform playerOrigin)
Parameters
playerOrigin: Transform
Returns
void