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

OVRPlayerController Class

Extends MonoBehaviour
Controls the player's movement in virtual reality.

Fields

The rate acceleration during movement.
The rate of damping on movement.
The rate of additional damping when moving sideways or backwards.
The force applied to the character when jumping.
The rate of rotation when using a gamepad.
The rate of rotation when using the keyboard.
The player will rotate in fixed steps if Snap Rotation is enabled.
[Deprecated] When enabled, snap rotation will happen about the guardian rather than the player/camera viewpoint.
How many fixed speeds to use with linear movement? 0=linear control.
If true, reset the initial yaw of the player controller when the Hmd pose is recentered.
If true, tracking data from a child OVRCameraRig will update the direction of movement.
Modifies the strength of gravity.
If true, each OVRPlayerController will use the player's physical height.
The CameraHeight is the actual height of the HMD and can be used to adjust the height of the character controller, which will affect the ability of the character to move into areas with a low ceiling.
This bool is set to true whenever the player controller has been teleported.
It is reset after every frame. Some systems, such as CharacterCameraConstraint, test this boolean in order to disable logic that moves the character controller immediately following the teleport.
When true, user input will be applied to linear movement.
Set this to false whenever the player controller needs to ignore input for linear movement.
When true, user input will be applied to rotation.
Set this to false whenever the player controller needs to ignore input for rotation.
Rotation defaults to secondary thumbstick.
You can allow either here. Note that this won't behave well if EnableLinearMovement is true.

Events

This event is raised after the character controller is moved.
This is used by the OVRAvatarLocomotion script to keep the avatar transform synchronized with the OVRPlayerController.
This event is raised immediately after the camera transform has been updated, but before movement is updated.
This event is raised right before the character controller is actually moved in order to provide other systems the opportunity to move the character controller in response to things other than user input, such as movement of the HMD.
See CharacterCameraConstraint.cs for an example of this.

Protected Fields

CharacterController Controller[Get]
OVRCameraRig CameraRig[Get]

Properties

float InitialYRotation[Get]

Protected Functions

virtual void UpdateController ( )

Member Functions

virtual void UpdateMovement ( )
Invoked by OVRCameraRig's UpdatedAnchors callback.
Allows the Hmd rotation to update the facing direction of the player.
Jump! Must be enabled manually.
Stop this instance.
Gets the move scale multiplier.
Parameters
moveScaleMultiplier
Move scale multiplier.
Sets the move scale multiplier.
Parameters
moveScaleMultiplier
Move scale multiplier.
Gets the rotation scale multiplier.
Parameters
rotationScaleMultiplier
Rotation scale multiplier.
Sets the rotation scale multiplier.
Parameters
rotationScaleMultiplier
Rotation scale multiplier.
Gets the allow mouse rotation.
Parameters
skipMouseRotation
Allow mouse rotation.
Sets the allow mouse rotation.
Parameters
skipMouseRotation
If set to true allow mouse rotation.
Gets the halt update movement.
Parameters
haltUpdateMovement
Halt update movement.
Sets the halt update movement.
Parameters
haltUpdateMovement
If set to true halt update movement.
Resets the player look rotation when the device orientation is reset.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon