When I try to make one animation change to another, the animation freezes.
Would your code be trying to change the animation on every frame? That would cause the animation to always reset, making it look frozen.