PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

GetUserCFrameEnabled

The GetUserCFrameEnabled function returns true if the specified Enum/UserCFrame virtual reality device (VR) is available to be listened to.

This can be used to determine whether a specified VR device, (e.g. UserCFrame.Head), is connected to the user’s game. If the specified VR device is connected, is it enabled (true). Otherwise, it is disabled (false).

This can also be used alongside the several /UserInputService VR functions and events.

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

Parameters

Name Type Default Description

The specified type of VR device.

Returns

Return Type Summary

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


Code Samples


VRService:GetUserCFrameEnabled

​​This example indicates whether the UserCFrame.Head VR device is enabled or disabled for the user. If the device is enabled, this prints “VR device is enabled!”. If the device is disabled, this prints “VR device is disabled!”.