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.

Protected Fields

CameraRig : OVRCameraRig
Signature
OVRCameraRig OVRPlayerController.CameraRig
Controller : CharacterController
Signature
CharacterController OVRPlayerController.Controller

Fields

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

Properties

InitialYRotation : float
[Get]
Signature
float OVRPlayerController.InitialYRotation

Events

CameraUpdated : Action
This event is raised immediately after the camera transform has been updated, but before movement is updated.
Signature
Action OVRPlayerController.CameraUpdated
PreCharacterMove : 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.
See CharacterCameraConstraint.cs for an example of this.
Signature
Action OVRPlayerController.PreCharacterMove
TransformUpdated : Action< Transform >
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.
Signature
Action<Transform> OVRPlayerController.TransformUpdated

Protected Methods

UpdateController ()
Signature
virtual void OVRPlayerController.UpdateController()
Returns
void

Methods

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