We use cookies on this site to enhance your user experience

VRService

VRService

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

Name Type Description
UserCFrame

Describes what UserCFrame is responsible for input in VR.

bool

Becomes true if any VR device is detected by Roblox.

Inherited from Instance

Archivable ClassName DataCost Name Parent RobloxLocked

Functions

Name Type Description
VRTouchpadMode

Returns the VRTouchpadMode indicating the mode of a specified VRTouchpad.

CFrame

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

bool

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

void

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

void

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

void

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

Inherited from Instance

ClearAllChildren Clone Destroy FindFirstAncestor FindFirstAncestorOfClass FindFirstAncestorWhichIsA FindFirstChild FindFirstChildOfClass FindFirstChildWhichIsA GetChildren GetDebugId GetDescendants GetFullName GetPropertyChangedSignal IsA IsAncestorOf IsDescendantOf WaitForChild

Events

Name Type Description

Fired when navigation is requested from the VRService.

Fires if the VRTouchpadMode of a VRTouchpad is changed.

Fired when a UserCFrame is changed.

Fires when a UserCFrame gets enabled or disabled.

Inherited from Instance

AncestryChanged Changed ChildAdded ChildRemoved DescendantAdded DescendantRemoving