natiny.animation.get_duration
natiny.animation.get_duration(animation) -> seconds
Returns how long the clip runs, in seconds.
Parameters
| Name | Type | Description |
|---|---|---|
animation |
number |
Animation handle from natiny.mesh.get_animation or natiny.mesh.find_animation |
Returns
| Type | Description |
|---|---|
number |
Length in seconds; 0 for a stale nonzero handle or a zero-duration clip |
Example
local run = natiny.mesh.find_animation(hero_mesh, "Running")
print(string.format("%.2fs", natiny.animation.get_duration(run)))