playMaker

Author Topic: Set Visibility and UI objects  (Read 134 times)

mgervais

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Set Visibility and UI objects
« on: April 14, 2019, 06: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

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4108
    • View Profile
    • jinxtergames
Re: Set Visibility and UI objects
« Reply #1 on: April 14, 2019, 01: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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14035
  • Official Playmaker Support
    • View Profile
Re: Set Visibility and UI objects
« Reply #2 on: April 14, 2019, 11:41:31 PM »
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

mgervais

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Set Visibility and UI objects
« Reply #3 on: April 15, 2019, 10:04:13 AM »
Thanks a million for your advises jean and djaydino. Your help is really appreciated. I will certainly explore those avenues.

Thanks again

Michel