data.a - Which returns data every frame, idle, walking etc (player animation)
The problem is, it starts animation over and over again instantly on every new frame
I need it to fire only once on every state change, since animations are looped and configured already
It has to detect state and prevent ‘animation.play’ until other state has arriwed
How to do it? Thanks
Before starting the animation you can check if data.a isn’t the current playing animation already. I think data.a is the animation state? I don’t know the exact code, but it should be something like below.
if (this.entity.anim.baseLayer.activeState !== data.a) {
// start animation
}
Sorry, I think it should be a little different because you want to check it for the other players? As I can see on your code you use the old animation component for those entities?