natiny.mesh.find_animation

Lua
natiny.mesh.find_animation(mesh, name) -> animation

Returns the clip of this name, or nil when the file has none.

Parameters

Name Type Description
mesh number Mesh handle
name string Clip name as natiny.animation.get_name reports it; compared exactly

Returns

Type Description
number Animation handle, or nil when there is no such clip

Example

Lua
local jump = natiny.mesh.find_animation(hero_mesh, "Jump")
if jump then
    natiny.animator.play(hero_animator, jump, 0.2)
end