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

VRDeviceName

VRService

string

The VRDeviceName property indicates the name of a connected Virtual Reality (VR) device. You can use this property to check the name of a connected VR device.

To check if Roblox detects any VR devices, you can check the VRService/VREnabled property.

Since VRService only runs client-side, this property will only work when used in a LocalScript.


Code Samples


VRService.VRDeviceName

This example checks if Roblox detects a VR device. If a VR device is detected, this prints the name of the device. If not, this example prints “No VR device detected!”.

local VRService = game:GetService("VRService")

if (VRService.VREnabled) then
	print(VRService.VRDeviceName)
else
	print("No VR device detected!")
end