My 2d animations are still run beneath or on top of the other animations when loading a saved game while you are still in the same scene.
So I see that old 2d animation that started to run when I saved the game
and still continues to run when I load this current saved scene with
the default 2d animation.
Why AC doesn't flush all old elements upon load?
For instance I have a 2d animation of a character standing idle. And a 2d
animation of this character raising arm when I click on it. Once I click
on it he starts raising his arm and the idle animation is
hidden(removed, forgoten). If I try to save my game while he raises his
arm and load it after in the same scene I can still see how he still
continues to rais his arm with the default idle animation being played
too.
But everything is fine when I load my saved game from another scene.
Btw. this is an old bug that I noticed but never had time to post it.
AC should flush clean those animations, or sort of quickly load another empty level and then your level.
Comments
Basically, it's impossible to save/restore the state of animations in Unity with any decent amount of reliabililty. What might work under one set of very specific conditions won't work for another. Therefore, AC bypasses all animation handling during the saving/loading of save game files - it's better to not do anything, than to potentially break something.
That's only to say the process isn't automatic. It just has to be done manually, by one of two ways:
You misunderstood me ther mate..
No, I don't want AC to save the state of the animations that started, I want them not to remain when I load my saved game when I load, while I'm in the same scene.
What AC actually does, it keeps playing animations if you started them, then saved the game and loaded your saved game while you are in the same scene (all without changing- moving to another scene)
But it is all good and works ok once you move to anotehr scene in the game and load your saved game.
So AC for some reason keeps playing it.
1. All in one scene with out changing it, quiting the game or anything.
2. Start an animation.
3. While the animation is being played save the game.
4. Load this very save (again not changing the scene or quiting the game).
5. You can see the animation is still being played - problem.
But it won't play if you load your saved game from anotehr scene or quit teh game and then load it.
Perhaps it is possible to implement and stop it being played when loading a saved game in the same scene where you saved your game.
I have tons of animations, also some game objects like characters, NPC, and other visual elements have more than 3-5 animations and to set everything to default at the start would be a killer. Not to mention some have conditions what animations to run when something is done.
Is there a way to tell load menu to load some an empty scene and then load qucikly the one that you want to load?
Can a feature like this be added to AC, when you load a level from saved games in the load menu?
(tell load menu to load some an empty scene and then load qucikly the one that you want to load)
This won't break the existing games.
(But obviously we want to keep all changes like variables, removed, added sprites visibility etc whatever we saved, otherwise what woudl be the point of saving the game if it reloads/resets clean )
However see yourself how it fits in the AC so it doesn't break other stuff and games. You know it better than me.