1 decade ago by Hazneliel
In the documentation it says:
.rewind()
Rewinds the animation to its first frame and resets the .loopCount
This method returns the animation itself. This is useful when switching between animations. E.g:
// In an entities .update() method
this.currentAnim = this.anims.jump.rewind();
But if I do like this in the update method, everytime it plays the frame 0, since each call to the update method is rewinding the animation to the first frame 0.
What do you think? where I have to rewind it?
.rewind()
Rewinds the animation to its first frame and resets the .loopCount
This method returns the animation itself. This is useful when switching between animations. E.g:
// In an entities .update() method
this.currentAnim = this.anims.jump.rewind();
But if I do like this in the update method, everytime it plays the frame 0, since each call to the update method is rewinding the animation to the first frame 0.
What do you think? where I have to rewind it?