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

SetTouchpadMode

The SetTouchpadMode function sets the mode of the specified Enum/VRTouchpad to the specified Enum/VRTouchpadMode.

This can be used to change the user’s virtual reality (VR) touchpad mode so that the user interacts with the game different using the touchpad. For more information about the different types of modes, see the Enum/VRTouchpadMode page.

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

pad

The specified VRTouchpad you want to set the mode of.

The mode you want to set the specified VRTouchpad to.

Returns

Return Type Summary

No return.


Code Samples


VRService:SetTouchpadMode

​This example sets the user’s VRTouchpad.Left touchpad mode to TouchMode.Touch. This means that the left touchpad is treated as ButtonB.

local VRService = game:GetService("VRService")

VRService:SetTouchpadMode(VRTouchpad.Left, TouchpadMode.Touch)