- Home /
how to fade out button for ever in unity ?
In my unity(5) project i have put a Button. I want to fade out my button.
GameObject.Find("Send").GetComponent< Image>().CrossFadeAlpha(0,2,false);
It's working and fade out my button but it will be shown button again if i move my mouse pointer! I don't understand what happened here . How can i solve this problem and fade out button for ever?
if the button only needs to show ones, you could destroy the button after fading out
Answer by sumeeton · Mar 29, 2015 at 10:44 AM
One quick trick is to disable the button component:
GameObject.Find("Send").GetComponent<Button>().enabled = false;
GameObject.Find("Send").GetComponent<Image>().CrossFadeAlpha(0,2,false);
it was not my answer but i used your trick and solved my problem by your way :)))
You cannot fade the button forever because the Button Script is running. Hence, this trick!
Your answer

Follow this Question
Related Questions
LoadFromMemory and LoadFromMemoryAsync Not working on hololens c# 0 Answers
Missing Player Size Statistics in the Editor Log after build with Unity 5.3 4 Answers
Coroutine 'cannot convert from 'System.Collections.IEnumerable' to 'string' 1 Answer
Save animation as gif in unity 3 Answers
After Update FB SDK 7.3.0, FBlogin() is not working. It is showing error dialog. 0 Answers