Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: danilofaria on April 24, 2016, 12:50:36 PM
-
I've been having a problem with NGUI.
If I touch a button in the UI and there is some game object right underneath it, then it also receives the event (more specifically OnMouseDown in my case).
This looks really bad and I don't want the objects to receive this event if the UI has received the even first.
What can I do about this?
Thanks!
Danilo
-
OnMouseDown is a Unity event. It's not an NGUI event, which is why NGUI can't do anything about it.
You should be using OnPress (bool isPressed) instead.
-
I added the OnPress (bool isPressed) method to my game object script but nothing happens. It doesn't get triggered.
What other steps do I need to take?
-
You need to make sure that the camera that draws this game object has UICamera script attached.
-
It works! Thanks!