getUnitMovesInfo: Difference between revisions

From Bohemia Interactive Community
No edit summary
m (Add params example)
Line 37: Line 37:
private _animInfo = getUnitMovesInfo player;
private _animInfo = getUnitMovesInfo player;
// velocity = displacement / time
// velocity = displacement / time
private _animVelocity = _animInfo # 4 vectorMultiply -1 / _animInfo # 2; // -1 is because man model is reversed, so the rtm animation moves "backwards"
private _animVelocity = _animInfo # 4 vectorMultiply -1 / _animInfo # 2; // -1 is because man model is reversed
// so the rtm animation moves "backwards"
</sqf>
 
|x2= <sqf>
getUnitMovesInfo player params [
"_moveProgress",
"_moveTime",
"_moveDuration",
"_moveFactor",
"_rtmStep",
"_gestureProgress",
"_gestureTime",
"_gestureDuration",
"_gestureFactor"
];
</sqf>
</sqf>


|seealso= [[switchMove]] [[switchGesture]] [[moveTime]] [[gestureState]] [[animationState]]
|seealso= [[switchMove]] [[switchGesture]] [[moveTime]] [[gestureState]] [[animationState]]
}}
}}

Revision as of 22:40, 28 February 2026

Hover & click on the images for description

Description

Description:
Returns various information about the unit moves (primary animation) and gestures (masked animation)
Groups:
Animations

Syntax

Syntax:
getUnitMovesInfo unit
Parameters:
unit: Object
Return Value:
Array format:
  • 0 - moveProgress: Number - move progress in range 0-1
  • 1 - moveTime: Number - move elapsed time (move progress * move duration)
  • 2 - moveDuration: Number - move duration in seconds
  • 3 - moveFactor: Number - move blend factor
  • 4 - rtmStep: Vector3D - rtm step (how many meters the unit will move after finishing the animation)
  • 5 - gestureProgress: Number - gesture progress in range 0-1
  • 6 - gestureTime: Number - gesture elapsed time (gesture progress * gesture duration)
  • 7 - gestureDuration: Number - gesture duration in seconds
  • 8 - gestureFactor: Number - gesture blend factor

Alternative Syntax

Syntax:
unit getUnitMovesInfo index
Parameters:
unit: Object
index: Number - index of property from the main syntax
Return Value:
Anything - Value of the requested property, or Nothing if index is invalid. See the main syntax.

Examples

Example 1:
// Getting the move velocity of the animation private _animInfo = getUnitMovesInfo player; // velocity = displacement / time private _animVelocity = _animInfo # 4 vectorMultiply -1 / _animInfo # 2; // -1 is because man model is reversed // so the rtm animation moves "backwards"
Example 2:
getUnitMovesInfo player params [ "_moveProgress", "_moveTime", "_moveDuration", "_moveFactor", "_rtmStep", "_gestureProgress", "_gestureTime", "_gestureDuration", "_gestureFactor" ];

Additional Information

See also:
switchMove switchGesture moveTime gestureState animationState

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note