- Home /
Serializing and restoring full Animation state
I'm working on a save/load system, and trying to save a full animator state at runtime (and then restore it when the player loads a saved game). This should work if the animator is transitioning between states, etc. Is there an easy way to dump the entire animator into a byte[] array and restore it from there?
Thanks!
I highly doubt it because the Unity-specific Types, like AnimationState and whatnot, are not serializable so a lot of workaround is needed. I could imagine that you could first get the current animationstate, then all the Animator variables you set yourself (bool, float, int) and based on their values deter$$anonymous$$e which, if any, transition is currently being processed, and then somehow getting the time of the transition.
Your answer
Follow this Question
Related Questions
Save and load serialization problem 0 Answers
AddMixingTransform with Mecanim 1 Answer
Error serializing a class to save / load 2 Answers
mecanim, adjusting character stance with mouse input using c# script 0 Answers
Manipulating an animation towards a target object (ie. The hand and arm lean towards the target) 1 Answer