I FINALLY managed to code an animation system that starts an animation when a certain button is pressed, then reverts back to a certain state as soon as you let go of the button.