PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

VRService

Show deprecated

VRService

Show deprecated

The VRService is a service that is responsible for handling interactions between Roblox and Virtual Reality (VR). If you’re interested in incorporating VR compatibility into your game, this is the service for you!

The primary purpose of this service is to allow for games to communication and cooperate with virtual reality decisions - such as VR headsets and controllers. It allows a LocalScript to perform different actions depending on the device, and in turn, helps developers provide the best experience for the end user seeking to experience Roblox using VR devices.

Some usages of this service include detecting whether a user has any connected VR devices, tracking when those devices move, and determining how those devices interact with the user’s in-game controls. In order to detect user input, the service must look for a service event. For example, the service can detect VR device movement via events such as VRService/UserCFrameChanged.

Notes

  1. The UserInputService also contains several events and functions useful for enhancing a player’s VR experience in your game.
  2. Since this service is client-side only, it will only work when used in a LocalScript. It will not work when used within a Script. Client-side only means that users in the game can only detect their own input - and not the input of other users.

Properties

UserCFrame

GuiInputUserCFrame

Describes what UserCFrame is responsible for input in VR.

bool

VREnabled

[ReadOnly] [NotReplicated]

Describes whether the user is using a virtual reality device

Functions

VRTouchpadMode

GetTouchpadMode ( VRTouchpad pad )

Returns the VRTouchpadMode indicating the mode of a specified VRTouchpad.

CFrame

GetUserCFrame ( UserCFrame type )

Returns a CFrame describing the position & orientation of a specified virtual reality device.

bool

GetUserCFrameEnabled ( UserCFrame type )

Returns true if the specified UserCFrame is available to be listened to.

void

RecenterUserHeadCFrame ( )

Recenters the CFrame to the current location of the VR headset being worn by the user.

void

RequestNavigation ( CFrame cframe , UserCFrame inputUserCFrame )

Requests navigation to the specified DataType/CFrame, using the specified /Enum/UserCFrame as the origin for the visualizer parabola.

void

SetTouchpadMode ( VRTouchpad pad , VRTouchpadMode mode )

Sets the mode of the specified VRTouchpad to the specified VRTouchpadMode.

Events

RBXScriptSignal

NavigationRequested ( CFrame cframe , UserCFrame inputUserCFrame )

Fired when navigation is requested from the VRService.

RBXScriptSignal

TouchpadModeChanged ( VRTouchpad pad , VRTouchpadMode mode )

Fires if the VRTouchpadMode of a VRTouchpad is changed.

RBXScriptSignal

UserCFrameChanged ( UserCFrame type , CFrame value )

Fired when a UserCFrame is changed.

RBXScriptSignal

UserCFrameEnabled ( UserCFrame type , bool enabled )

Fires when a UserCFrame gets enabled or disabled.