I don't think this has anything to do with the animation in the model. I think there's a mistake in the code