# VRService

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Service
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/VRService/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/VRService

Service responsible for handling interactions between Roblox and Virtual Reality (VR).

## Properties

### AutomaticScaling

```luau
VRService.AutomaticScaling: Enum.VRScaling = Enum.VRScaling.World
```

- Tags: Capabilities: Input

Automatically adjusts scaling in VR to align the player with their avatar.

### AvatarGestures

```luau
VRService.AvatarGestures: boolean = false
```

- Tags: Capabilities: Input

When true, a VR player will be able to animate their hands and head using their controllers and headset.

### ControllerModels

```luau
VRService.ControllerModels: Enum.VRControllerModelMode = Enum.VRControllerModelMode.Transparent
```

- Tags: Capabilities: Input

Controls whether and how the player's VR hand controllers are rendered in the experience.

### FadeOutViewOnCollision

```luau
VRService.FadeOutViewOnCollision: boolean = true
```

- Tags: Read capabilities: Input

When true, a VR player's view will fade to black when their head collides with an object.

### GuiInputUserCFrame

```luau
VRService.GuiInputUserCFrame: Enum.UserCFrame = Enum.UserCFrame.Head
```

- Tags: Not replicated, Capabilities: Input

Describes what `UserCFrame` is responsible for input in VR.

### LaserPointer

```luau
VRService.LaserPointer: Enum.VRLaserPointerMode = Enum.VRLaserPointerMode.Pointer
```

- Tags: Capabilities: Input

Controls whether and how the VR laser pointer used to interact with the user interface is displayed.

### DidPointerHit

```luau
VRService.DidPointerHit: boolean = false
```

- Tags: Hidden, Read only, Roblox script security, Read capabilities: Input

### LaserDistance

```luau
VRService.LaserDistance: number = 50
```

- Tags: Hidden, Read only, Roblox script security, Read capabilities: Input

### PointerHitCFrame

```luau
VRService.PointerHitCFrame: CFrame = CFrame.identity
```

- Tags: Hidden, Read only, Roblox script security, Read capabilities: Input

### PresentationMode

```luau
VRService.PresentationMode: Enum.VRPresentationMode = Enum.VRPresentationMode.Stereo
```

- Tags: Hidden, Read only, Roblox script security, Read capabilities: Input

### QuestASWState

```luau
VRService.QuestASWState: boolean = false
```

- Tags: Hidden, Not replicated, Roblox script security, Read capabilities: Input

### QuestDisplayRefreshRate

```luau
VRService.QuestDisplayRefreshRate: number = 0
```

- Tags: Hidden, Not replicated, Roblox script security, Read capabilities: Input

### ThirdPersonFollowCamEnabled

```luau
VRService.ThirdPersonFollowCamEnabled: boolean = true
```

- Tags: Read only, Capabilities: Input

Indicates whether the third-person follow camera is enabled for the VR user.

### VRDeviceAvailable

```luau
VRService.VRDeviceAvailable: boolean = false
```

- Tags: Hidden, Read only, Roblox script security, Read capabilities: Input

### VRDeviceName

```luau
VRService.VRDeviceName: string = ""
```

- Tags: Hidden, Read only, Roblox script security, Read capabilities: Input

### VREnabled

```luau
VRService.VREnabled: boolean = false
```

- Tags: Read only, Capabilities: Input

Describes whether the user is using a virtual reality device.

### VRSessionState

```luau
VRService.VRSessionState: Enum.VRSessionState = Enum.VRSessionState.Undefined
```

- Tags: Hidden, Read only, Roblox script security, Read capabilities: Input

## Methods

### GetTouchpadMode

```luau
VRService:GetTouchpadMode(pad: Enum.VRTouchpad): Enum.VRTouchpadMode
```

- Tags: Capabilities: Input

Returns the VRTouchpadMode indicating the mode of a specified VRTouchpad.

Parameters:

- `pad`: The specified `VRTouchpad`.

Returns: The mode of the specified `VRTouchpad`.

### GetUserCFrame

```luau
VRService:GetUserCFrame(type: Enum.UserCFrame): CFrame
```

- Tags: Capabilities: Input

Returns a CFrame describing the position & orientation of a specified virtual reality device as an offset from a point in real world space.

Parameters:

- `type`: The specified `UserCFrame`.

Returns: A [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) describing the position and orientation of the specified VR device as an offset from a point in real-world space.

### GetUserCFrameEnabled

```luau
VRService:GetUserCFrameEnabled(type: Enum.UserCFrame): boolean
```

- Tags: Capabilities: Input

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

Parameters:

- `type`: The specified type of VR device.

Returns: A boolean indicating whether the specified VR device is enabled (`true`) or disabled (`false`).

### IsMaquettes

```luau
VRService:IsMaquettes(): boolean
```

- Tags: Roblox script security, Capabilities: Input

### IsVRAppBuild

```luau
VRService:IsVRAppBuild(): boolean
```

- Tags: Roblox script security, Capabilities: Input

### RecenterUserHeadCFrame

```luau
VRService:RecenterUserHeadCFrame()
```

- Tags: Capabilities: Input

Re-centers the [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) to the current location of the VR headset being worn by the user.

### RequestNavigation

```luau
VRService:RequestNavigation(cframe: CFrame, inputUserCFrame: Enum.UserCFrame)
```

- Tags: Capabilities: Input

Requests navigation to the specified [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) using the specified `UserCFrame` as the origin for the visualizer parabola.

Parameters:

- `cframe`: The specified [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) coordinates.
- `inputUserCFrame`: The VR device for which the navigation is requested.

### SetTouchpadMode

```luau
VRService:SetTouchpadMode(pad: Enum.VRTouchpad, mode: Enum.VRTouchpadMode)
```

- Tags: Capabilities: Input

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

Parameters:

- `pad`: The specified `VRTouchpad` you want to set the mode of.
- `mode`: The mode you want to set the specified `VRTouchpad` to.

## Events

### LaserPointerTriggered

```luau
VRService.LaserPointerTriggered: RBXScriptSignal<(input: InputObject)>
```

- Tags: Roblox script security, Capabilities: Input

### NavigationRequested

```luau
VRService.NavigationRequested: RBXScriptSignal<(cframe: CFrame, inputUserCFrame: Enum.UserCFrame)>
```

- Tags: Capabilities: Input

Fired when navigation is requested from [`VRService`](https://rapi.sleaze.dev/classes/VRService.md).

### TouchpadModeChanged

```luau
VRService.TouchpadModeChanged: RBXScriptSignal<(pad: Enum.VRTouchpad, mode: Enum.VRTouchpadMode)>
```

- Tags: Capabilities: Input

Fires if the `VRTouchpadMode` of a `VRTouchpad` is changed.

### UserCFrameChanged

```luau
VRService.UserCFrameChanged: RBXScriptSignal<(type: Enum.UserCFrame, value: CFrame)>
```

- Tags: Capabilities: Input

Fires when a `UserCFrame` is changed.

### UserCFrameEnabled

```luau
VRService.UserCFrameEnabled: RBXScriptSignal<(type: Enum.UserCFrame, enabled: boolean)>
```

- Tags: Capabilities: Input

Fires when a `UserCFrame` is enabled or disabled.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
