So there is some interesting things about the animation API, especially when it comes to using AnimationState.
It seems like Animation states, which animations are enabled, and more (I’m not sure what else) get reset when you disable / enable a gameobject with an animation. All the layers are set back to 0, for instance.
Is this intended functionality, and if so, why isn’t it documented? If not, what are the other pitfalls?
Some other weird things: If you play an animation by name, editing the animation state for that name takes effect, however if it is the default clip and you play it with Play(), changing the animation state for the default clip does not effect playback.
Animations set to Once have a normalizedTime at 0 once they finish playing, where I would expect they would sit at 1.0, Clamp forever does not finish playing, so if it was a 1 second animation, and you let it play for 8, setting the speed to -1 would not start the backwards animation for 7 seconds. I would expect it would start right away, or that Once would fulfill this role.
One other thing I don’t get about the animation API is why it insists on using Strings for looking up the animations states or referring to clips. We have the AnimationClip type and you would think it would be best to just pass in the object.
These are just comments, I don’t really care which way Unity implements animations as long is there is consistency with the documentation, and that stranger parts such as above are documented.
What other strange things have you guys noticed with Animations? Maybe if we talk about it we can get it worked out on our own.