I’ve been hitting this issue with the animation engine and simplified it down to this basic problem that I was wondering if anyone had a solution to.
I created a scene with two UI panels.
There are two animations linked with an exit transition set to 1.0. The initial animation turns panel 1 on, and panel 2 off.
When the initial animation is done, it moves on to animation 2 which doesn’t do anything, except loop.
What I expected to see was no visible change. Panel 1 is on and Panel 2 is off. What I actually see is both panels turn on. Is there any way to get the animation engine to leave things as they are when it exits an animation?
By default, when the animation engine detect that an animated property is not animated in a clip, the engine write the default value in this property.
In 4.6 and 5.0 we did add a new member called Write Defaults on an Animator State, by default this value is true.
This new member control if the engine should write or not default value on property not animated by any clip while evaluating this state.
Your explanation seems unclear to me. Should this new Write Defaults setting be disabled if we want things to be left as they are upon exiting a state?
If a state’s clip is not animating a property, if you don’t want this state to reset this property to the default value you need to uncheck WriteDefaults on this state.
I have a similar problem that is not fixed by un-checking WriteDefaults. What I need to do is change to another animation state, and then change the value of a property using code, whilst the animation is still running.
With WriteDefaults = true, the animator will overwrite a property with the ‘default’ value.
With WriteDefaults = false, the animator will overwrite a property it’s value at the time the animation state is entered.
What I could like, and I feel would be more useful, is for the animator to just leave the property untouched - for the duration of the animation. Surely, this would make the greatest amount of sense?