How can I play an animation once?
The code I have works with a looping animation, but not when I do not want it to loop. The animation simply doesn’t play.
The project is here: PlayCanvas | HTML5 Game Engine
Take a look at the “Instructor” scene, and press 2 to focus on the colored cube. The topright blue cube should begin to animate, but it only does so when I set it to loop in the code. (see Processes/Process 1/Step 2/Animate Command for the object with the script that controls it)
EDIT: Perhaps an issue with the anim.assignAnimation() function? I noticed a bug where I couldn’t assign multiple animations if I provide the optional parameters for speed and loop, but it works when I remove them (despite having used the default parameters). I’m not sure if the issues are related.