Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Alatriste on March 12, 2019, 03:05:18 PM

Title: Prevent clicks behind UI panels and buttons [SOLVED]
Post by: Alatriste on March 12, 2019, 03:05:18 PM
Hi,

I'm having some issues with my settings panel not stopping the interaction with the objects placed behind it. I was looking for answers, but I couldn't make anything to work (people was sharing scripts to kind of hack this behavior), and I don't know if there is a clean way to do this using playmaker.

Thanks!
Title: Re: Prevent clicks behind UI panels and buttons
Post by: ch1ky3n on March 12, 2019, 03:14:13 PM
are you doing a 2d game?
use graphic raycaster on your UI
what is the setup of your canvas? is it an overlay? screen? world?
Title: Re: Prevent clicks behind UI panels and buttons
Post by: Alatriste on March 12, 2019, 04:45:03 PM
Yes, it's a 2D game.
I'm using the raycaster on my panel, but somehow the triggers behind they still get activated.
The "Canvas Settings" is the parent and the "Panel Settings" is the child, which is just a black panel with transparency that should stop any interaction behind it.
Title: Re: Prevent clicks behind UI panels and buttons
Post by: ch1ky3n on March 12, 2019, 04:54:17 PM
can you send the SS of the object behind it?
the one that keep getting clicked
Title: Re: Prevent clicks behind UI panels and buttons
Post by: Alatriste on March 12, 2019, 05:29:16 PM
Sure thing.
The "Clickable 2D" script is added by Fungus (a VN addon), which basically set the object so it can be referenced by the Fungus editor.
Title: Re: Prevent clicks behind UI panels and buttons
Post by: ch1ky3n on March 12, 2019, 06:04:36 PM
Can you try to remove the script and use normal collider for the item and see if it works?  I believe there something on the script that causes all of this. unless looking at the script, its hard to tell.

Have you tried to check the ‘use event system’ on the clickble script ? It is an input module for unity, who knows if it might produce something magic.

Finally, you can use trick like disable the clickable component if the setting panel pop up. And enable it again once you are done

Good Luck
Title: Re: Prevent clicks behind UI panels and buttons
Post by: Alatriste on March 12, 2019, 06:24:11 PM
You were right! "Use Event System" made trick! I cannot believe I missed such an obvious option!  :-[ Thanks for taking the time to look into my problem. :D