How to keep animation playing when animated object exits the viewport
I'm creating a turn-based game and I'm using animations to smoothly move actors around from one cell to another. The animation that moves them emits an event at the end, so that the engine knows when it can start animating the next actor.
I'm not playing the animation for actors outside the player's field of view.
My issue is that when an actor is animated and he exists the viewport during the animation, the animation is suppressed and the event is not emitted. The engine doesn't know that it can pass control to next actor, so the game freezes.
How can I solve this problem? If there's a way to force playing this animation even if the animated object is outside the viewport, I can do it, because I play this animation anyway only when player sees the animated object. But maybe there's a more elegant solution?
Your answer
![](https://koobas.hobune.stream/wayback/20220612171333im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Do not call animation event. 0 Answers
Animation Event Audio Clip not working! 1 Answer
How to copy and paste animation events from one clip to another if those clips are included in FBXs? 1 Answer
Animation Event not firing or skip problem (When Fast Animation) 0 Answers
Can I call more than one function in a Animation Event? 0 Answers