Can someone please help me understand what C3 is doing here and why it works the way it does?
With this code, animationSpeed is only set properly in the 3rd scenario. The first 2 scenarios set the animation properly, but use the default speed vs the 60 I set in the code. Why?
Also, wait(0) feels like a hack. Is there a better/proper way to do what I want without using wait(0)?
https://drive.google.com/file/d/1Jkd0pM4u2OmluelqqqGsBMBBLliBEzzg/view?usp=drive_link
Hi.
There's no loop set in your animation settings.
Of course, once the animation ends, you'll need to run it again.
As for the wait you're adding, it's just a workaround—it simply forces the instructions below it to execute on the next frame.
Develop games in your browser. Powerful, performant & highly capable.
Thanks but I should have clarified that I don't want to use looping animations. This code is a fragment from a function that changes the animation once an existing one completes. It also changes the animation speed at that time (different from the animation speed set in the animation editor).
So my question still stands. Why does C3 work this way, and why do I need to use Wait(0) at all? Seems like when an animation ends, I should be able to set a new animation AND set its speed at that time.