For thread safety, this property is not safe to read in an unsynchronized thread.
SetDescription will set the description of an action bound by
ContextActionService/BindAction|BindAction. In a list of available actions, this would be text that describes the given action.
Although the name may suggest that this method is related to the family of functions that customize a touch button for actions that create them (
ContextActionService/SetPosition|SetPosition), this method does not affect such a button. This method merely sets a text description of an action, and nothing more.
The name of the action originally passed to BindAction
A text description of the action, such as “Honk the car’s horn” or “Open the inventory”
ContextActionService Touch Button
This code sample demonstrates binding an “Inspect” action to a touch button created automatically by
ContextActionService. The button is customized using
ContextActionService/SetPosition|SetPosition. The button is further customized by using
ContextActionService/GetButton|GetButton to get a reference to the
ImageButton itself and tinting it green by setting
Paste this code into a
LocalScript placed within
StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.