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

OVRHeadsetEmulator Class

Extends MonoBehaviour
This script enables you to emulate the movement of a headset directly in the Unity Editor.
Any app that uses the OVRCameraRig or OVRPlayerController prefabs will enable the emulator. Otherwise, you can attach the OVRHeadsetEmulator to a game object. For more information, see https://developer.oculus.com/documentation/unity/unity-hmd-emulation/.

Fields

activateKeys : KeyCode[]
The key to activate the headset movement emulation.
Signature
KeyCode [] activateKeys
opMode : OpMode
The current scope of the headset movement.
By default, OVRHeadsetEmulator.opMode is set to EditorOnly, which make it effective only in the Unity Editor preview window. Set it to AlwaysOn to activate the function in standalone builds.
Signature
OpMode opMode
pitchKeys : KeyCode[]
The key to adjust the pitch of the headset movement emulation.
Signature
KeyCode [] pitchKeys
resetHmdPoseByMiddleMouseButton : bool
Whether to cancel all the modification to the headset pose when the middle button is pressed.
Signature
bool resetHmdPoseByMiddleMouseButton
resetHmdPoseOnRelease : bool
Whether the headset pose should be restored when you press the activate key (e.g.
Ctrl).
Signature
bool resetHmdPoseOnRelease

Inner Enum

OpMode Enum

The scope of the headset movement enumeration.

Enumeration Constants

Member
Off
EditorOnly
AlwaysOn