- Home /
Question by
DarkFang100 · Apr 14, 2021 at 02:32 AM ·
uitextalphacrossfade
How to have CrossFadeAlpha activate more than once when pressing a key?
So I'm trying to make a text use CrossFadeAlpha to fade in and out on the click of a keyboard key (e). However, it only fades in and out once and never shows back up. The code that I'm using to make it happen:
void Update()
{
if(Input.GetKeyDown(KeyCode.E) && canEnterDoor == true)
{
quotes.text = "You have entered a door.";
quotes.CrossFadeAlpha(0.0f, 2.5f, false);
}
else if (Input.GetKeyDown(KeyCode.E) && canEnterDoor == false)
{
quotes.text = "You have interacted with nothing.";
quotes.CrossFadeAlpha(0.0f, 2.5f, false);
}
}
How could I make it so that the CrossFadeAlpha works not just one time?
Comment
Your answer
Follow this Question
Related Questions
Stop crossfadealpha 1 Answer
How to make a "Click to Continue" text message? 1 Answer
How to add string once to the UI text, but update the substring every frame in unity? 0 Answers
I need to resize my text to button to be visible using Unity 4.6 UI 2 Answers
How To Change Color Of Text On UI When It's Selected | Unity 4.6 3 Answers