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

GuiInputUserCFrame

VRService

UserCFrame

The GuiInputUserCFrame property describes what Enum/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 VRService/VREnabled property.

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


Code Samples


VRService.GuiInputUserCFrame

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

local VRService = game:GetService("VRService")

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