You are reading the
(unstable) version of this documentation, which may document features not available
or compatible with Godot 3.x.
Checking the stable version of the documentation...
Work in progress
Godot documentation is being updated to reflect the latest changes in version
4.0. Some documentation pages may
still state outdated information. This banner will tell you if you're reading one of such pages.
The contents of this page are up to date. If you can still find outdated information, please open an issue.
Inherits: Resource < RefCounted < Object
An OpenXR action.
This resource defines an OpenXR action. Actions can be used both for inputs (buttons/joystick/trigger/etc) and outputs (haptics).
OpenXR performs automatic conversion between action type and input type whenever possible. An analog trigger bound to a boolean action will thus return
false if the trigger is depressed and
true if pressed fully.
Actions are not directly bound to specific devices, instead OpenXR recognizes a limited number of top level paths that identify devices by usage. We can restrict which devices an action can be bound to by these top level paths. For instance an action that should only be used for hand held controllers can have the top level paths "/user/hand/left" and "/user/hand/right" associated with them. See the reserved path section in the OpenXR specification for more info on the top level paths.
Note that the name of the resource is used to register the action with.
ActionType OPENXR_ACTION_BOOL =
This action provides a boolean value.
ActionType OPENXR_ACTION_FLOAT =
This action provides a float value between
1.0 for any analog input such as triggers.
ActionType OPENXR_ACTION_VECTOR2 =
This action provides a vector2 value and can be bound to embedded trackpads and joysticks
ActionType OPENXR_ACTION_POSE =
ActionType action_type =
void set_action_type ( ActionType value )
ActionType get_action_type ( )
The type of action.
String localized_name =
The localized description of this action.
PackedStringArray toplevel_paths =
void set_toplevel_paths ( PackedStringArray value )
PackedStringArray get_toplevel_paths ( )
A collections of toplevel paths to which this action can be bound.