- Home /
Can t change alpha of sprite while animator is enabled.
In the game should be blue circle, which is hidden until mouse is clicked. After click it appears on screen with animation and after another click it fades with animation. Ball is hidden by script, it changes alpha at start(). But it doesn't change it, as animator is enabled. So in my game I actually see a circle without any clicking. After click it begins to appear from 0 alpha to 1. Why is that? How the problem can be solved without disabling animator?
In the scene I have one sprite (simple blue circle), animator, attached to it and script. Animator has three states: empty state (no animation, set as default), intro (animation: sprite's alpha changes from 0 to 1 and scale) and dead (animation: sprite's alpha changes from 1 to 0 and scale). My script does a few things: at start makes sprites alpha = 0, and after some event set animator's trigger to "Intro". After it is being played, script changes alpha to 1.
Answer by SeasiaInfotechind · Nov 06, 2015 at 05:12 AM
Hi, You can keep your blue circle alpha to 0 prior running any animation, so when you start the game your circle wont be visible.Once you click it will start from alpha 0 to alpha 1. Also if second fading is not working as expected .you can add number of keys reducing alpha value.Check screenshot given
You didn't understand me correctly. I have animator, which is playing state with no animation. And while it is being played, I can't change alpha of sprite. Even while game is running, in pause mode, I change alpha in inspector, turn play and alpha reverses back.
Your answer
Follow this Question
Related Questions
Can't animate Sprite correctly 0 Answers
How to change the alpha of a sprite 1 Answer
Transparency When DistanceProblem 0 Answers
Void OnTriggerEnter not working 1 Answer
Change sprite in a sprite renderer with an animation 0 Answers