natiny.animator.get_time

Lua
natiny.animator.get_time(animator) -> seconds

Returns how far into its clip the animator is.

Parameters

Name Type Description
animator number Animator handle from natiny.animator.create

Returns

Type Description
number Position in the current clip, in seconds; 0 for a stale nonzero animator handle or one without a clip

Example

Lua
local t = natiny.animator.get_time(hero_legs)
local d = natiny.animation.get_duration(natiny.animator.get_animation(hero_legs))
print(string.format("%.2f / %.2f", t, d))