Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, how can I get the current Anitmation name in the game cycle? engine.OnAnimate = function() { // Do something in the game cycle var currentAnim = player.getCurrentAnimation(); console.log(currentAnim.name); // Expose: 'walk' e.g. // So I can play a footstep sound als long as the animation is 'walk' }; |
||||
|
AFAIK, there is no simple function for this, but you can use getNamedAnimationRangeByName from the skinned mesh class to do this. Use code like this to see if currently the animation you want is playing (in my example, the animation "stand":
|
||||
|
Cool, thanks, works great this way! |
|