getUnitMovesInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 32: Line 32:
|r2= [[Anything]] - Value of the requested property, or [[Nothing]] if index is invalid. See the main syntax.
|r2= [[Anything]] - Value of the requested property, or [[Nothing]] if index is invalid. See the main syntax.


|x1= <sqf>_animInfo = getUnitMovesInfo player;
|x1= <sqf> // Getting the move velocity of the animation
_animInfo = getUnitMovesInfo player;
// velocity = displacement / time
// velocity = displacement / time
_animVelocity = _animInfo#4 vectorMultiply -1 / _animInfo#2; // -1 is because man model is reversed, so rtm animation moves "backwards"
_animVelocity = _animInfo#4 vectorMultiply -1 / _animInfo#2; // -1 is because man model is reversed, so rtm animation moves "backwards"

Revision as of 08:59, 29 February 2024

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 in format:
  • 0 - Number - move progress in range 0-1
  • 1 - Number - move elapsed time (move progress * move duration)
  • 2 - Number - move duration
  • 3 - Number - move blend factor
  • 4 - Vector3D - rtm step (how many meters the unit will move after finishing the animation)
  • 5 - Number - gesture progress in range 0-1
  • 6 - Number - gesture elapsed time (gesture progress * gesture duration)
  • 7 - Number - gesture duration
  • 8 - 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 _animInfo = getUnitMovesInfo player; // velocity = displacement / time _animVelocity = _animInfo#4 vectorMultiply -1 / _animInfo#2; // -1 is because man model is reversed, so rtm animation moves "backwards"

Additional Information

See also:
switchMove switchGesture moveTime gestureState animationState

Notes

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