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

UserCFrameEnabled

The UserCFrameEnabled event fires when a Enum/UserCFrame gets enabled or disabled.

This can be used alongside VRService\GetUserCFrameEnabled to track whether a specified UserCFrame is enabled, and when its state changes. It can also be used alongside /UserInputService service events and functions.

Since the event fires locally, it can only be used in a /LocalScript.

Parameters

Name Type Default Description

The UserCFrame getting enabled or disabled.

A boolean indicating whether the UserCFrame is enabled (true) or disabled (false).


Code Samples


VRService.UserCFrameEnabled

‚ÄčThis example fires when a UserCFrame changes state, printing the name of the changed UserCFrame and whether it changed got enabled or disabled.

local VRService = game:GetService("VRService")

VRService.UserCFrameEnabled:Connect(function(type, enabled)
	if (enabled) then
		print(type.Name + " got enabled!")
	else
		print(type.Name + " got disabled!")
end)