I have a scenario where an animation needs to run just once and then stop (basically no looping endlessly). In my present case, it is a door or a window sliding or swinging open or shut. I noticed an animation stop event in game editor so here is what I came up with as a possible solution:
1) The change animation function is triggered by an event and plays in the forward direction when the door or window is opened
2) The animation stop event is added to that object and it triggers another change animation function that shows the animation state as "stopped" so that the animation stops once the door or window is completely open
3) When this open door or window needs to be shut, the event triggers a change animation function that plays the animation in reverse
4) The animation stop event stops the animation once it has completed, thereby freezing the door or window shut
I'm not sure if this is the standard way to do this, so I'd just like to clarify whether this is how it needs to be done or whether there is a better suited way to doing this.