Jump to content

[SOLVED] Can I playback the animation once in UnigineScript?


photo

Recommended Posts

I made a model button, it can be pressed and automatic recovery.

 

But in my practice, it can't playback in current state.

ObjectSkinnedMesh m_skinnedmesh;

....

m_skinnedmesh.setAnimation(0,m_animationName);

...
float time=engine.app.getTime();
m_skinnedmesh.setFrame(0,time*30);


I want to playback the animation once comletely

  • Like 1
Link to comment

Combine the setSpeed(), play() and setLoop() functions to play your animation once.

 

e.g.

 

    ObjectMeshSkinned osm,

    osm = node_cast(engine.editor.getNode(engine.editor.findNode("mynode")));
 
    osm.setAnimation("animations/foo.sanim");
    osm.setSpeed(30);
    osm.setTime(0.0f);
    osm.setLoop(0);
    osm.play();
Link to comment
×
×
  • Create New...