A few questions to help understand what you are trying to achieve
1. Why not use the random number as animation state. e.g state(x) instead of if statements?
2. Why do you have waitTime calls, this is seen as bad practice in while loops and could be causing the stuttering?
I would approach as follows.
1. Use random number to assign animation e.g "tree.state(x)"
2. Use "viz.PATH_EVENT" to trigger next animation
3. Use <animationpath>.setPaused() to pause\resume for strong gust
Let me know if that suits\makes sense
|