VRService
Service responsible for handling interactions between Roblox and Virtual Reality (VR).
Memory category | Instances |
---|
Member index 29
Description
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.
History 103
- 638 Add LaserPointer
- 638 Add ControllerModels
- 623 Change Tags of AvatarGestures from [NotBrowsable] to []
- 623 Change Tags of VRService from [NotCreatable, Service, NotBrowsable] to [NotCreatable, Service]
- 614 Change CanSave of VREnabled from true to false
- 614 Change CanSave of from true to false
- 614 Change Tags of from [Hidden] to [Hidden, NotReplicated]
- 614 Change Tags of from [Hidden] to [Hidden, NotReplicated]
- 614 Change CanSave of from true to false
- 614 Change CanSave of from true to false
- 614 Change Tags of FadeOutViewOnCollision from [NotReplicated] to []
- 614 Change CanSave of from true to false
- 614 Change Tags of AutomaticScaling from [NotReplicated] to []
- 612 Change Category of GuiInputUserCFrame from Data to Behavior
- 612 Change Category of FadeOutViewOnCollision from Data to Behavior
- 612 Add AvatarGestures
- 612 Change Category of AutomaticScaling from Data to Behavior
- 610 Change Default of from to Undefined
- 610 Change Default of VREnabled from to false
- 610 Change Default of from to
- 610 Change Default of from to false
- 610 Change Default of ThirdPersonFollowCamEnabled from to true
- 610 Change Default of from to 0
- 610 Change Default of from to false
- 610 Change Default of from to
- 610 Change Default of from to 50
- 610 Change Tags of GuiInputUserCFrame from [] to [NotReplicated]
- 610 Change Default of GuiInputUserCFrame from to Head
- 610 Change CanLoad of FadeOutViewOnCollision from false to true
- 610 Change Tags of FadeOutViewOnCollision from [] to [NotReplicated]
- 610 Change Default of FadeOutViewOnCollision from to true
- 610 Change CanSave of FadeOutViewOnCollision from false to true
- 610 Change Default of from to false
- 610 Change CanLoad of AutomaticScaling from false to true
- 610 Change CanSave of AutomaticScaling from false to true
- 610 Change Default of AutomaticScaling from to World
- 610 Change Tags of VRService from [NotCreatable, Service] to [NotCreatable, Service, NotBrowsable]
- 592 Add ThirdPersonFollowCamEnabled
- 592 Add
- 592 Add
- 573 Change ReturnType of SetTouchpadMode from void to null
- 573 Change ReturnType of RequestNavigation from void to null
- 573 Change ReturnType of RecenterUserHeadCFrame from void to null
- 572 Add LaserPointerTriggered
- 570 Add AutomaticScaling
- 559 Add FadeOutViewOnCollision
- 553 Change Default of from to
- 553 Change Default of VREnabled from to
- 553 Change Default of from to
- 553 Change Default of from to
- 553 Change Default of from to
- 553 Change Default of from to
- 553 Change Default of GuiInputUserCFrame from to
- 553 Change Default of from to
- 550 Add
- 548 Add IsVRAppBuild
- 548 Add IsMaquettes
- 543 Add
- 520 Add
- 520 Add
- 501 Add
- 486 Change ThreadSafety of VREnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of GuiInputUserCFrame from ReadOnly to ReadSafe
- 469 Change Tags of from [ReadOnly, NotReplicated] to [Hidden, ReadOnly, NotReplicated]
- 462 Change ThreadSafety of UserCFrameEnabled from to Unsafe
- 462 Change ThreadSafety of UserCFrameChanged from to Unsafe
- 462 Change ThreadSafety of TouchpadModeChanged from to Unsafe
- 462 Change ThreadSafety of NavigationRequested from to Unsafe
- 462 Change ThreadSafety of SetTouchpadMode from to Unsafe
- 462 Change ThreadSafety of RequestNavigation from to Unsafe
- 462 Change ThreadSafety of RecenterUserHeadCFrame from to Unsafe
- 462 Change ThreadSafety of GetUserCFrameEnabled from to Unsafe
- 462 Change ThreadSafety of GetUserCFrame from to Unsafe
- 462 Change ThreadSafety of GetTouchpadMode from to Unsafe
- 462 Change ThreadSafety of VREnabled from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of GuiInputUserCFrame from to ReadOnly
- 310 Add TouchpadModeChanged
- 310 Add SetTouchpadMode
- 310 Add GetTouchpadMode
- 310 Add
- 310 Change WriteSecurity of GuiInputUserCFrame from RobloxScriptSecurity to None
- 310 Change ReadSecurity of GuiInputUserCFrame from RobloxScriptSecurity to None
- 274 Add NavigationRequested
- 274 Add RequestNavigation
- 265 Add UserCFrameEnabled
- 265 Add UserCFrameChanged
- 265 Add RecenterUserHeadCFrame
- 265 Add GetUserCFrameEnabled
- 265 Add GetUserCFrame
- 265 Add VREnabled
- 265 Add GuiInputUserCFrame
- 265 Add VRService
- 264 Remove VRService
- 265 Add UserCFrameEnabled
- 265 Add UserCFrameChanged
- 265 Add RecenterUserHeadCFrame
- 265 Add GetUserCFrameEnabled
- 265 Add GetUserCFrame
- 265 Add VREnabled
- 265 Add GuiInputUserCFrame
- 265 Add VRService
Members 29
AutomaticScaling
Type | Default | |
---|---|---|
VRScaling | World |
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.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 6
- 614 Change Tags of AutomaticScaling from [NotReplicated] to []
- 612 Change Category of AutomaticScaling from Data to Behavior
- 610 Change CanLoad of AutomaticScaling from false to true
- 610 Change CanSave of AutomaticScaling from false to true
- 610 Change Default of AutomaticScaling from to World
- 570 Add AutomaticScaling
AvatarGestures
Type | Default | |
---|---|---|
bool | false |
When set to true, a VR player will be able to animate their hands and head using their controllers and headset.
This property must be set on the server.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 2
- 623 Change Tags of AvatarGestures from [NotBrowsable] to []
- 612 Add AvatarGestures
ControllerModels
Type | Default | |
---|---|---|
VRControllerModelMode | Transparent |
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 1
- 638 Add ControllerModels
FadeOutViewOnCollision
Type | Default | |
---|---|---|
bool | true |
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.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 7
- 614 Change Tags of FadeOutViewOnCollision from [NotReplicated] to []
- 612 Change Category of FadeOutViewOnCollision from Data to Behavior
- 610 Change CanLoad of FadeOutViewOnCollision from false to true
- 610 Change Tags of FadeOutViewOnCollision from [] to [NotReplicated]
- 610 Change Default of FadeOutViewOnCollision from to true
- 610 Change CanSave of FadeOutViewOnCollision from false to true
- 559 Add FadeOutViewOnCollision
GetTouchpadMode
Parameters (1) | ||
---|---|---|
pad | VRTouchpad | |
Returns (1) | ||
VRTouchpadMode |
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.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetTouchpadMode from to Unsafe
- 310 Add GetTouchpadMode
GetUserCFrame
Parameters (1) | ||
---|---|---|
type | UserCFrame | |
Returns (1) | ||
CFrame |
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.
Thread safety | Unsafe |
---|
History 4
- 462 Change ThreadSafety of GetUserCFrame from to Unsafe
- 265 Add GetUserCFrame
- 264 Remove VRService
- 265 Add GetUserCFrame
GetUserCFrameEnabled
Parameters (1) | ||
---|---|---|
type | UserCFrame | |
Returns (1) | ||
bool |
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.
Thread safety | Unsafe |
---|
History 4
- 462 Change ThreadSafety of GetUserCFrameEnabled from to Unsafe
- 265 Add GetUserCFrameEnabled
- 264 Remove VRService
- 265 Add GetUserCFrameEnabled
GuiInputUserCFrame
Type | Default | |
---|---|---|
UserCFrame | Head |
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.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | false |
History 11
- 612 Change Category of GuiInputUserCFrame from Data to Behavior
- 610 Change Tags of GuiInputUserCFrame from [] to [NotReplicated]
- 610 Change Default of GuiInputUserCFrame from to Head
- 553 Change Default of GuiInputUserCFrame from to
- 486 Change ThreadSafety of GuiInputUserCFrame from ReadOnly to ReadSafe
- 462 Change ThreadSafety of GuiInputUserCFrame from to ReadOnly
- 310 Change WriteSecurity of GuiInputUserCFrame from RobloxScriptSecurity to None
- 310 Change ReadSecurity of GuiInputUserCFrame from RobloxScriptSecurity to None
- 265 Add GuiInputUserCFrame
- 264 Remove VRService
- 265 Add GuiInputUserCFrame
IsMaquettes
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
bool |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 548 Add IsMaquettes
IsVRAppBuild
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
bool |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 548 Add IsVRAppBuild
LaserPointer
Type | Default | |
---|---|---|
VRLaserPointerMode | Pointer |
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 1
- 638 Add LaserPointer
LaserPointerTriggered
Parameters (1) | |
---|---|
input | InputObject |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
RecenterUserHeadCFrame
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
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.
Thread safety | Unsafe |
---|
History 5
- 573 Change ReturnType of RecenterUserHeadCFrame from void to null
- 462 Change ThreadSafety of RecenterUserHeadCFrame from to Unsafe
- 265 Add RecenterUserHeadCFrame
- 264 Remove VRService
- 265 Add RecenterUserHeadCFrame
SetTouchpadMode
Parameters (2) | ||
---|---|---|
pad | VRTouchpad | |
mode | VRTouchpadMode | |
Returns (1) | ||
null |
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.
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of SetTouchpadMode from void to null
- 462 Change ThreadSafety of SetTouchpadMode from to Unsafe
- 310 Add SetTouchpadMode
ThirdPersonFollowCamEnabled
Type | Default | |
---|---|---|
bool | true |
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 2
- 610 Change Default of ThirdPersonFollowCamEnabled from to true
- 592 Add ThirdPersonFollowCamEnabled
TouchpadModeChanged
Parameters (2) | |
---|---|
pad | VRTouchpad |
mode | VRTouchpadMode |
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.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of TouchpadModeChanged from to Unsafe
- 310 Add TouchpadModeChanged
UserCFrameChanged
Parameters (2) | |
---|---|
type | UserCFrame |
value | CFrame |
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.
Thread safety | Unsafe |
---|
History 4
- 462 Change ThreadSafety of UserCFrameChanged from to Unsafe
- 265 Add UserCFrameChanged
- 264 Remove VRService
- 265 Add UserCFrameChanged
UserCFrameEnabled
Parameters (2) | |
---|---|
type | UserCFrame |
enabled | bool |
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.
Thread safety | Unsafe |
---|
History 4
- 462 Change ThreadSafety of UserCFrameEnabled from to Unsafe
- 265 Add UserCFrameEnabled
- 264 Remove VRService
- 265 Add UserCFrameEnabled
VREnabled
Type | Default | |
---|---|---|
bool | false |
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.
1 2 3 4 5 6 7 8 |
|
This property can only be used in a LocalScript.
See Also
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 8
- 614 Change CanSave of VREnabled from true to false
- 610 Change Default of VREnabled from to false
- 553 Change Default of VREnabled from to
- 486 Change ThreadSafety of VREnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of VREnabled from to ReadOnly
- 265 Add VREnabled
- 264 Remove VRService
- 265 Add VREnabled