GSC reference › Built-in

GetAnimLength()

Built-in (engine) Server

Gets the length of an animation

Signature

GetAnimLength(<animation>)

Parameters

NameRequired?Details
animationRequired a primitive animation: calling this function on a non-primitive animation will fail

Example (from Treyarch's docs)

cycleTime = GetAnimLength( climbAnim )

Real uses in BO3's scripts

Called 99 times in the decompiled scripts. A few, zombies first:

Related built-ins

  • GetZBarrierPieceAnimLengthForState()
    Returns the length in seconds for the animation associated with the supplied state for a piece, in seconds.
  • UseAnimTree()
    Sets the anim tree for the entity
  • ClearAnim()
    Sets an animation's goal weight (and the goal weights of all of its descendents) to zero over the specified time.
  • AnimScripted()
    Runs an animscript on an entity.
  • SetAnim()
    Restart": These functions cause the animation to restart.
  • Length()
    Returns the length of the given vector
  • StopAnimScripted()
    Halts animscript on this entity.
  • AnimMode()
    Set the way that animation deltas are interpreted by the game engine
  • ASMSetAnimationRate()
    Change the delta animation rate for the entity using ASM.
  • LengthSquared()
    Returns the squared vector length for the given vector - this is cheaper than the actual vector length as it doesn't involve a square root
  • HasAnimTree()
    Returns true if the entity has an anim tree
  • SetAnimRestart()
    See "SetAnim.

New to GSC?

Start with the basics, or paste a compile error to get the fix.

Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).