Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mgervais on April 14, 2019, 09:18:50 AM

Title: Set Visibility and UI objects
Post by: mgervais on April 14, 2019, 09:18:50 AM
Hi guys,

Quick question. Does the play maker command "Set Visibility" can be applied to UI objects (buttons panels and so forth) ?

I have a quiz question in a photosphere made of a canevas, panel and a dropdown as children. I'm trying to hide the canevas or the panel when entering the sphere and triger it's visibility with the click of a button. It doesn't seem to work despite that Playmaker script runs as expected with no errors returned.

Any help would be apreciated.

Thanks
Title: Re: Set Visibility and UI objects
Post by: djaydino on April 14, 2019, 04:53:54 PM
Hi.
"Set Visibility" will not work on ui.


You can use 'Activate Component' to enable/disable the the image component.
Or 'Activate Game Object' to enable/disable the whole game object or panel.

If you have the ui image type set to filled, then you could also use "Ui Image Set Fill Amount" and set from 0 to 1.
The last one you could animate the fill amount by using 'Float Interpolate' (or some tweening)

You can also use 'Ui Graphic Set Color' and set the Alpha (0 - 1)
This can also be animated
Title: Re: Set Visibility and UI objects
Post by: jeanfabre on April 15, 2019, 02:41:31 AM
Hi,

 also make sure to check out the CanvasGroup component which allows you set alpha over its entire children, it's very convenient and powerful to use that component for showing windows, panels etc etc.

https://docs.unity3d.com/Manual/class-CanvasGroup.html

 Bye,

 Jean
Title: Re: Set Visibility and UI objects
Post by: mgervais on April 15, 2019, 01:04:13 PM
Thanks a million for your advises jean and djaydino. Your help is really appreciated. I will certainly explore those avenues.

Thanks again

Michel