Usually in a game scene there might be tens of animations going on at the same time, each being in its own state. I wonder usually how is this managed in game engines? Do they just stack a variable indicating the state of the animation on entity? Or do they use a separate animation system to keep all states?
In unity it is handled with a node system. each node is an animation you made earlier, and you connect them in the order you want them to be played. You can also control when they are played by scripts, and then the node system gets more complicated with transitions. you can set a transition to occur when a boolean is true, or false, or when an integer is equal to 0 or 1 or less than or greater than etc.