Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
VRService
Inherits from: Instance → Object
VRService is responsible for handling interactions between Roblox and Virtual Reality (VR). Its methods, properties, and events help you provide the best experience for end users seeking to experience Roblox on VR devices.
See VR Guidelines for more information on publishing an experience for VR devices.
Inherits from: Instance
Memory category: Instances
Tags: NotCreatable, Service
Code samples: View on Creator Hub (VRService).
Properties
| Name | Type / Returns | Description |
|---|---|---|
| VRService.AutomaticScaling | VRScaling | Automatically adjusts scaling in VR to align the player with their avatar. |
| VRService.AvatarGestures | boolean | When true, a VR player will be able to animate their hands and head using their controllers and headset. |
| VRService.ControllerModels | VRControllerModelMode | Controls whether and how the player's VR hand controllers are rendered in the experience. |
| VRService.FadeOutViewOnCollision | boolean | When true, a VR player's view will fade to black when their head collides with an object. |
| VRService.GuiInputUserCFrame | UserCFrame | Describes what UserCFrame is responsible for input in VR. |
| VRService.LaserPointer | VRLaserPointerMode | Controls whether and how the VR laser pointer used to interact with the user interface is displayed. |
| VRService.ThirdPersonFollowCamEnabled | boolean | Indicates whether the third-person follow camera is enabled for the VR user. |
| VRService.VREnabled | boolean | Describes whether the user is using a virtual reality device. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.Archivable | boolean | Determines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published. |
| Instance.archivable | boolean | |
| Instance.Capabilities | SecurityCapabilities | The set of capabilities allowed to be used for scripts inside this container. |
| Instance.IsInSandbox | boolean | Indicates whether the instance is inside a sandboxed container. |
| Instance.Name | string | A non-unique identifier of the Instance. |
| Instance.Parent | Instance | Determines the hierarchical parent of the Instance. |
| Instance.PredictionMode | PredictionMode | Reflects the client-side prediction mode applied to the instance under server-authoritative physics. |
| Instance.RobloxLocked | boolean | A deprecated property that used to protect CoreGui objects. |
| Instance.Sandboxed | boolean | When enabled, the instance can only access abilities in its Capabilities list. |
| Instance.UniqueId | UniqueId | A unique identifier for the instance. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
VRService.AutomaticScaling
When set to VRScaling.World, Camera.HeadScale adjusts so that the scale of the world is seen from the avatar's perspective. A player with a small avatar will perceive the objects around them as larger than a player with a large avatar will.
| Field | Value |
|---|---|
| type | VRScaling |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Input"] |
VRService.AvatarGestures
When set to true, a VR player will be able to animate their hands and head using their controllers and headset. Set this to false for experiences where VR hand and head tracking conflicts with custom game mechanics, such as bespoke avatar rigs or weapon systems incompatible with IK-driven gestures.
This property must be set on the server.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Input"] |
VRService.ControllerModels
Controls how the models representing the player's VR hand controllers are displayed (VRControllerModelMode). When set to Transparent, the controller models are shown with transparency; when set to Disabled, the controller models are not rendered.
Defaults to Transparent.
| Field | Value |
|---|---|
| type | VRControllerModelMode |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Input"] |
VRService.FadeOutViewOnCollision
When true, a VR player's view fades to black when their head collides with an object. This property prevents players from being able to see through walls while in VR. The default value is true.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Input"] |
VRService.GuiInputUserCFrame
This property describes what UserCFrame is responsible for input in VR. For instance, if a VR headset is responsible, the value of this property will be UserCFrame.Head.
To check if Roblox detects any VR devices, which would be responsible for input in VR, you can check the VREnabled property.
| Field | Value |
|---|---|
| type | UserCFrame |
| tags | ["NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-GuiInputUserCFrame).
VRService.LaserPointer
Controls the mode of the laser pointer that a VR player uses to point at and interact with the user interface (VRLaserPointerMode). Set it to Disabled to hide the laser pointer, Pointer to show a single pointer, or DualPointer to show a pointer for each hand.
Defaults to Pointer.
| Field | Value |
|---|---|
| type | VRLaserPointerMode |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Input"] |
VRService.ThirdPersonFollowCamEnabled
Read-only. Indicates whether the third-person follow camera is enabled for the VR user. Its value mirrors the user's VR comfort setting and updates automatically whenever the user changes that setting, firing a changed signal so that scripts can respond. It cannot be set from a script.
| Field | Value |
|---|---|
| type | boolean |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Input"] |
VRService.VREnabled
This property describes whether the user is using a virtual reality (VR) device.
If a VR device is enabled, you can interact with its location and movement through methods such as UserInputService:GetUserCFrame(). You can also react to VR device movement using the UserInputService.UserCFrameChanged event.
local UserInputService = game:GetService("UserInputService")
local isUsingVR = UserInputService.VREnabled
if isUsingVR then
print("User is using a VR headset!")
else
print("User is not using a VR headset!")
end This property can only be used in a LocalScript.
See Also
| Field | Value |
|---|---|
| type | boolean |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":false} |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (UserInputService-UserCFrameChanged).
Methods
| Name | Type / Returns | Description |
|---|---|---|
| VRService:GetTouchpadMode | VRTouchpadMode | Returns the VRTouchpadMode indicating the mode of a specified VRTouchpad. |
| VRService:GetUserCFrame | CFrame | Returns a CFrame describing the position & orientation of a specified virtual reality device as an offset from a point in real world space. |
| VRService:GetUserCFrameEnabled | boolean | Returns true if the specified UserCFrame is available to be listened to. |
| VRService:RecenterUserHeadCFrame | () | Re-centers the CFrame to the current location of the VR headset being worn by the user. |
| VRService:RequestNavigation | () | Requests navigation to the specified CFrame using the specified UserCFrame as the origin for the visualizer parabola. |
| VRService:SetTouchpadMode | () | Sets the mode of the specified VRTouchpad to the specified VRTouchpadMode. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance:AddTag | () | Applies a tag to the instance. |
| Instance:children | Instances | Returns an array of the object's children. |
| Instance:ClearAllChildren | () | This method destroys all of an instance's children. |
| Instance:Clone | Instance | Create a copy of an instance and all its descendants, ignoring instances that are not Archivable. |
| Instance:clone | Instance | |
| Instance:Destroy | () | Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children. |
| Instance:destroy | () | |
| Instance:FindFirstAncestor | Instance? | Returns the first ancestor of the Instance whose Instance.Name is equal to the given name. |
| Instance:FindFirstAncestorOfClass | Instance? | Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className. |
| Instance:FindFirstAncestorWhichIsA | Instance? | Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstChild | Instance? | Returns the first child of the Instance found with the given name. |
| Instance:findFirstChild | Instance | |
| Instance:FindFirstChildOfClass | Instance? | Returns the first child of the Instance whose ClassName is equal to the given class name. |
| Instance:FindFirstChildWhichIsA | Instance? | Returns the first child of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstDescendant | Instance? | Returns the first descendant found with the given Instance.Name. |
| Instance:GetActor | Actor? | Returns the Actor associated with the Instance, if any. |
| Instance:GetAttribute | Variant | Returns the value which has been assigned to the given attribute name. |
| Instance:GetAttributeChangedSignal | RBXScriptSignal | Returns an event that fires when the given attribute changes. |
| Instance:GetAttributes | Dictionary | Returns a dictionary of the instance's attributes. |
| Instance:GetChildren | Instances | Returns an array containing all of the instance's children. |
| Instance:getChildren | Instances | |
| Instance:GetDebugId | string | Returns a coded string of the debug ID used internally by Roblox. |
| Instance:GetDescendants | Instances | Returns an array containing all of the descendants of the instance. |
| Instance:GetFullName | string | Returns a string describing the instance's ancestry. |
| Instance:GetStyled | Variant | Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. |
| Instance:GetStyledPropertyChangedSignal | RBXScriptSignal | Returns an event that fires when the given style property changes on the instance. |
| Instance:GetTags | Array | Gets an array of all tags applied to the instance. |
| Instance:HasTag | boolean | Check whether the instance has a given tag. |
| Instance:IsAncestorOf | boolean | Returns true if an Instance is an ancestor of the given descendant. |
| Instance:IsDescendantOf | boolean | Returns true if an Instance is a descendant of the given ancestor. |
| Instance:isDescendantOf | boolean | |
| Instance:IsPropertyModified | boolean | Returns true if the value stored in the specified property is not equal to the code-instantiated default. |
| Instance:QueryDescendants | Instances | Returns an array containing all descendants of the instance that match the selector string. |
| Instance:Remove | () | Sets the object's Parent to nil, and does the same for all its descendants. |
| Instance:remove | () | |
| Instance:RemoveTag | () | Removes a tag from the instance. |
| Instance:ResetPropertyToDefault | () | Resets a property to its default value. |
| Instance:SetAttribute | () | Sets the attribute with the given name to the given value. |
| Instance:WaitForChild | Instance | Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
VRService:GetTouchpadMode
This method returns the VRTouchpadMode indicating the mode of a specified VRTouchpad. The returned mode indicates how the user interacts with their touchpad to play the game.
This can also be used alongside the several UserInputService VR methods and events.
This method will only work when used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| pad | VRTouchpad | The specified VRTouchpad. |
Returns
| Type | Description |
|---|---|
| VRTouchpadMode | The mode of the specified VRTouchpad. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-GetTouchpadMode).
VRService:GetUserCFrame
This method returns a CFrame describing the position and orientation of a specified virtual reality (VR) device as an offset from a point in real world space. This method should be used when implementing VR compatibility into a game to obtain and track the movement of a connected VR device.
By using the method, developers can implement features such as re-positioning the user's in-game character corresponding to the location of a connected VR device. This can be done by changing the CFrame of the user's in-game character to match the CFrame of the specified VR device using the UserCFrame enum and CFrame value arguments passed by the event.
VRService also provides a UserCFrameChanged event that automatically fires when the CFrame of connected VR device changes, so long it is used in a LocalScript.
This method will only work when used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| type | UserCFrame | The specified UserCFrame. |
Returns
| Type | Description |
|---|---|
| CFrame | A CFrame describing the position and orientation of the specified VR device as an offset from a point in real-world space. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-GetUserCFrame).
VRService:GetUserCFrameEnabled
This method returns true if the specified UserCFrame virtual reality device (VR) is available to be listened to. It can be used to determine whether a specified VR device, such as UserCFrame.Head, is connected to the user's game.
This can also be used alongside the several UserInputService VR methods and events.
This method will only work when used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| type | UserCFrame | The specified type of VR device. |
Returns
| Type | Description |
|---|---|
| boolean | A boolean indicating whether the specified VR device is enabled (true) or disabled (false). |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-GetUserCFrameEnabled).
VRService:RecenterUserHeadCFrame
This method re-centers the CFrame of the user's head to the current location of the VR headset being worn by the user. It can be used to ensure that the user's in-game head is positioned according to the location of the user's VR headset.
This behaves identically to UserInputService:RecenterUserHeadCFrame().
This method will only work when used in a LocalScript.
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-RecenterUserHeadCFrame).
VRService:RequestNavigation
This method requests navigation to the specified CFrame using the specified UserCFrame as the origin for the visualizer parabola. It can be used to incorporate virtual reality (VR) into your game by providing a means to visualize a navigation path from the user's VR device to a destination.
VRService has a similar event, NavigationRequested, used to detect such requests. This can also be used alongside the several UserInputService VR methods and events.
This method will only work when used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| cframe | CFrame | The specified CFrame coordinates. | |
| inputUserCFrame | UserCFrame | The VR device for which the navigation is requested. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-RequestNavigation).
VRService:SetTouchpadMode
This method sets the mode of the specified VRTouchpad to the specified VRTouchpadMode. It can be used to change the user's virtual reality (VR) touchpad mode so that the user interacts with the game differently using the touchpad.
This can also be used alongside the several UserInputService VR methods and events.
This method will only work when used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| pad | VRTouchpad | The specified VRTouchpad you want to set the mode of. | |
| mode | VRTouchpadMode | The mode you want to set the specified VRTouchpad to. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-SetTouchpadMode).
Events
| Name | Type / Returns | Description |
|---|---|---|
| VRService.NavigationRequested | Fired when navigation is requested from VRService. | |
| VRService.TouchpadModeChanged | Fires if the VRTouchpadMode of a VRTouchpad is changed. | |
| VRService.UserCFrameChanged | Fires when a UserCFrame is changed. | |
| VRService.UserCFrameEnabled | Fires when a UserCFrame is enabled or disabled. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.AncestryChanged | Fires when the Instance.Parent property of this object or one of its ancestors is changed. | |
| Instance.AttributeChanged | Fires whenever an attribute is changed on the Instance. | |
| Instance.ChildAdded | Fires after an object is parented to this Instance. | |
| Instance.childAdded | ||
| Instance.ChildRemoved | Fires after a child is removed from this Instance. | |
| Instance.DescendantAdded | Fires after a descendant is added to the Instance. | |
| Instance.DescendantRemoving | Fires immediately before a descendant of the Instance is removed. | |
| Instance.Destroying | Fires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy(). | |
| Instance.StyledPropertiesChanged | Fires whenever any style property is changed on the instance, including when a property is set to nil. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |
VRService.NavigationRequested
This event fires when navigation is requested from VRService for a specified UserCFrame VR device. It fires with a CFrame coordinate and the specified UserCFrame indicating the device requesting the navigation.
This event can be used alongside UserInputService service events and methods.
Since this event fires locally, it can only be used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| cframe | CFrame | The requested CFrame coordinates. | |
| inputUserCFrame | UserCFrame | Indicates the VR device for which navigation is requested. |
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-NavigationRequested).
VRService.TouchpadModeChanged
This event fires if the VRTouchpadMode of a VRTouchpad is changed. You can use this event to track the states of VR touchpads connected via the user's client.
This event can be used alongside UserInputService service events and methods.
Since this event fires locally, it can only be used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| pad | VRTouchpad | The touchpad that changed mode. | |
| mode | VRTouchpadMode | The new mode. |
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-TouchpadModeChanged).
VRService.UserCFrameChanged
This event fires when a UserCFrame is changed, for instance when the user moves a connected VR device. It can be used alongside GetUserCFrame() to track the CFrame coordinates of a VR device, and when it changes/moves. It can also be used alongside UserInputService service events and methods.
Since this event fires locally, it can only be used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| type | UserCFrame | The type of VR device that changed. | |
| value | CFrame | The updated CFrame coordinates of the VR device after the change. |
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-UserCFrameChanged).
VRService.UserCFrameEnabled
This event fires when a UserCFrame is enabled or disabled. It can be used alongside GetUserCFrameEnabled() to track whether a specified UserCFrame is enabled, and when its state changes. It can also be used alongside UserInputService service events and methods.
Since this event fires locally, it can only be used in a LocalScript.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| type | UserCFrame | The UserCFrame getting enabled or disabled. | |
| enabled | boolean | A boolean indicating whether the UserCFrame is enabled (true) or disabled (false). |
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Input"] |
Code samples: View on Creator Hub (VRService-UserCFrameEnabled).