Control actuation
Control actuation refers to whether or not a control is currently being used by the user.
A control is considered "actuated" when it has moved away from its default state in such a way that it affects the actual value of the control. Use IsActuated to query whether a control is currently actuated.
The recommended workflow is to bind controls to actions, and then respond to input at runtime by polling or recieving callbacks from those actions. For this reason, it is not typically necessary to directly check whether a control is actuated. Instead, actuation of a control bound to an action causes the action to be performed (according to its interaction pattern, if an interaction has been assigned).
However in some scenarios you might want to directly read the actuation of a control.
Directly read the actuation of a control
You can query whether a control is currently actuated using IsActuated.
It looks like the sample you are looking for does not exist.
It can be useful to determine not just whether a control is actuated at all, but also the amount by which it is actuated (that is, its magnitude). For example, for a Vector2Control this is the length of the vector, whereas for a button it is the raw, absolute floating-point value.
In general, the current magnitude of a control is always greater than or equal to zero. However, a control might not have a meaningful magnitude, in which case it returns -1. Any negative value should be considered an invalid magnitude.
You can query the current amount of actuation using EvaluateMagnitude.
It looks like the sample you are looking for does not exist.
These two mechanisms use control actuation:
- Interactive rebinding (
InputActionRebindingExceptions.RebindOperation) uses it to select between multiple suitable controls to find the one that is actuated the most. - Conflict resolution between multiple controls that are bound to the same action uses it to decide which control gets to drive the action.