Since we're talking about the loop()
method, let's start discussing some of the different controls for playing and stopping animations. There are four basic methods we can use:
play("AnimName")
: This method plays the animation once from beginning to end.loop("AnimName")
: This method is similar to play, but the animation doesn't stop when it's over; it replays again from the beginning.stop()
orstop("AnimName")
: This method, if called without an argument, stops all the animations currently playing on theActor
. If called with an argument, it only stops the named animation.pose("AnimName", FrameNumber)
: Places theActor
in the pose dictated by the supplied frame without playing the animation.
We have some more advanced options as well. Firstly, we can provide option fromFrame
and toFrame
arguments to play or loop to restrict the animation to specific frames.
myActor.play("AnimName...