Page 1 of 1

[Feature Request] Allow SetActive to optionally fade in images via alpha

Posted: Fri Feb 15, 2019 7:20 am
by DragoonHP
What I want to do is, fade in a specific object on the screen. I can do it by attaching an Animator to the object but it becomes quite tedious if it needs to be done for multiple objects. I know another way is to using a CoRoutine and changing the alpha of the image from zero to 1.

Something like

Code: Select all

SetActive(gameObject, 1.0)
where 1.0 is the time it will take the gameObject alpha to increase from 0 to 1

Re: [Feature Request] Allow SetActive to optionally fade in images via alpha

Posted: Fri Feb 15, 2019 9:32 am
by Tony Li
Hi,

This isn't possible to do in a general case. UI elements can fade in at least one of two different ways (Canvas Groups or Image alpha), and non-UI elements may not be able to fade at all.

You could write a custom sequencer command that covers the cases you need. It's probably easier than writing a different script with a coroutine.

Re: [Feature Request] Allow SetActive to optionally fade in images via alpha

Posted: Fri Feb 15, 2019 10:30 am
by DragoonHP
Okay :)