- Home /
Unity UI Animation does not set end value
I am using the Unity Animation to fade out a UI popup with the quest status. I am using a "Canvas Group" component, and animates the Alpha value. The animation is straight forward, goes from 1 -> 0 over x seconds.
The problem is, it won't fade out fully. When the animation is done the alpha value is about 0.03 or so. Which is NOT 0, and it is possible to faintly see the popup UI.
Why does the animation not set the alpha to 0, when I have a keyframe where the value is 0?
My animator controller contains 3 states:
Empty state (when nothing happens)
Open popup state
Close popup state
All the states have "Write Defaults" set to off.
It starts in the Empty state, there is no animation or anything associated with this state. When a trigger "Open Popup trigger" is set it goes from Empty State to the "Open Popup" state. When the Popup is open, it returns to the empty state.
I will then set another trigger "Close Popup trigger" to close it and it goes from the Empty state to the "Close Popup"-state. When the "Close Popup"-state is finished, the alpha value is NOT set fully to 0.
EDIT
I have tried using StateMachineBehaviour and OnStateExit set the alpha to 0, but due to the property is controlled by the Animatior, it won't let me change it, so it is stuck at about 0.03.
I want it to become 0, so it becomes fully transparent.
Your answer
![](https://koobas.hobune.stream/wayback/20220612090014im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity 5 Controlling Animation with UI Button 0 Answers
Text animation not working in play mode 0 Answers
Wait for animation to finish and do something 1 Answer
Animating only one part of the menu 0 Answers