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

OVRPlayerController Class

Controls the player's movement in virtual reality.
OVRPlayerController extends MonoBehaviour.

Overview

Data Fields

float
The rate acceleration during movement.
float
Damping[Get]
The rate of damping on movement.
float
The rate of additional damping when moving sideways or backwards.
float
The force applied to the character when jumping.
float
The rate of rotation when using a gamepad.
float
The rate of rotation when using the keyboard.
bool
The player will rotate in fixed steps if Snap Rotation is enabled.
bool
[Deprecated] When enabled, snap rotation will happen about the guardian rather than the player/camera viewpoint.
int
How many fixed speeds to use with linear movement? 0=linear control.
bool
If true, reset the initial yaw of the player controller when the Hmd pose is recentered.
bool
If true, tracking data from a child OVRCameraRig will update the direction of movement.
float
Modifies the strength of gravity.
bool
If true, each OVRPlayerController will use the player's physical height.
float
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.
bool
This bool is set to true whenever the player controller has been teleported.
bool
When true, user input will be applied to linear movement.
bool
When true, user input will be applied to rotation.
bool
Rotation defaults to secondary thumbstick.

Events

Action< Transform >
This event is raised after the character controller is moved.
Action
This event is raised immediately after the camera transform has been updated, but before movement is updated.
Action
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.

Object Data

CharacterController

Properties

Object Data

Public Member Functions

void
void
Invoked by OVRCameraRig's UpdatedAnchors callback.
bool
Jump ( )
Jump! Must be enabled manually.
void
Stop ( )
Stop this instance.
void
GetMoveScaleMultiplier
( ref float moveScaleMultiplier )
Gets the move scale multiplier.
void
SetMoveScaleMultiplier
( float moveScaleMultiplier )
Sets the move scale multiplier.
void
GetRotationScaleMultiplier
( ref float rotationScaleMultiplier )
Gets the rotation scale multiplier.
void
SetRotationScaleMultiplier
( float rotationScaleMultiplier )
Sets the rotation scale multiplier.
void
GetSkipMouseRotation
( ref bool skipMouseRotation )
Gets the allow mouse rotation.
void
SetSkipMouseRotation
( bool skipMouseRotation )
Sets the allow mouse rotation.
void
GetHaltUpdateMovement
( ref bool haltUpdateMovement )
Gets the halt update movement.
void
SetHaltUpdateMovement
( bool haltUpdateMovement )
Sets the halt update movement.
void
Resets the player look rotation when the device orientation is reset.

Details

Fields

float OVRPlayerController.Acceleration
The rate acceleration during movement.
float OVRPlayerController.Damping
The rate of damping on movement.
float OVRPlayerController.BackAndSideDampen
The rate of additional damping when moving sideways or backwards.
float OVRPlayerController.JumpForce
The force applied to the character when jumping.
float OVRPlayerController.RotationAmount
The rate of rotation when using a gamepad.
float OVRPlayerController.RotationRatchet
The rate of rotation when using the keyboard.
bool OVRPlayerController.SnapRotation
The player will rotate in fixed steps if Snap Rotation is enabled.
bool OVRPlayerController.RotateAroundGuardianCenter
[Deprecated] When enabled, snap rotation will happen about the guardian rather than the player/camera viewpoint.
int OVRPlayerController.FixedSpeedSteps
How many fixed speeds to use with linear movement? 0=linear control.
bool OVRPlayerController.HmdResetsY
If true, reset the initial yaw of the player controller when the Hmd pose is recentered.
bool OVRPlayerController.HmdRotatesY
If true, tracking data from a child OVRCameraRig will update the direction of movement.
float OVRPlayerController.GravityModifier
Modifies the strength of gravity.
bool OVRPlayerController.useProfileData
If true, each OVRPlayerController will use the player's physical height.
float OVRPlayerController.CameraHeight
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.
bool OVRPlayerController.Teleported
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.
bool OVRPlayerController.EnableLinearMovement
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.
bool OVRPlayerController.EnableRotation
When true, user input will be applied to rotation.
Set this to false whenever the player controller needs to ignore input for rotation.
bool OVRPlayerController.RotationEitherThumbstick
Rotation defaults to secondary thumbstick.
You can allow either here. Note that this won't behave well if EnableLinearMovement is true.

Events

Action<Transform> OVRPlayerController.TransformUpdated ( )
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.
Action OVRPlayerController.CameraUpdated ( )
This event is raised immediately after the camera transform has been updated, but before movement is updated.
Action OVRPlayerController.PreCharacterMove ( )
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.

Object Data

CharacterController OVRPlayerController.Controller
No description available.
OVRCameraRig OVRPlayerController.CameraRig
No description available.

Properties

float OVRPlayerController.InitialYRotation
No description available.

Object Data

virtual void OVRPlayerController.UpdateController ( )
No description available.

Member Functions

virtual void OVRPlayerController.UpdateMovement ( )
No description available.
void OVRPlayerController.UpdateTransform
( OVRCameraRig rig )
Invoked by OVRCameraRig's UpdatedAnchors callback.
Allows the Hmd rotation to update the facing direction of the player.
bool OVRPlayerController.Jump ( )
Jump! Must be enabled manually.
void OVRPlayerController.Stop ( )
Stop this instance.
void OVRPlayerController.GetMoveScaleMultiplier
( ref float moveScaleMultiplier )
Gets the move scale multiplier.
Parameters
moveScaleMultiplier
Move scale multiplier.
void OVRPlayerController.SetMoveScaleMultiplier
( float moveScaleMultiplier )
Sets the move scale multiplier.
Parameters
moveScaleMultiplier
Move scale multiplier.
void OVRPlayerController.GetRotationScaleMultiplier
( ref float rotationScaleMultiplier )
Gets the rotation scale multiplier.
Parameters
rotationScaleMultiplier
Rotation scale multiplier.
void OVRPlayerController.SetRotationScaleMultiplier
( float rotationScaleMultiplier )
Sets the rotation scale multiplier.
Parameters
rotationScaleMultiplier
Rotation scale multiplier.
void OVRPlayerController.GetSkipMouseRotation
( ref bool skipMouseRotation )
Gets the allow mouse rotation.
Parameters
skipMouseRotation
Allow mouse rotation.
void OVRPlayerController.SetSkipMouseRotation
( bool skipMouseRotation )
Sets the allow mouse rotation.
Parameters
skipMouseRotation
If set to true allow mouse rotation.
void OVRPlayerController.GetHaltUpdateMovement
( ref bool haltUpdateMovement )
Gets the halt update movement.
Parameters
haltUpdateMovement
Halt update movement.
void OVRPlayerController.SetHaltUpdateMovement
( bool haltUpdateMovement )
Sets the halt update movement.
Parameters
haltUpdateMovement
If set to true halt update movement.
void OVRPlayerController.ResetOrientation ( )
Resets the player look rotation when the device orientation is reset.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon