Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: krubba1 on May 13, 2015, 02:05:31 PM

Title: Obj with collider and event trigger needs sprite to receive click?
Post by: krubba1 on May 13, 2015, 02:05:31 PM
I had 2 objects with colliders, say a character object that resides behind a screen sized clickable collider. In the editor the screen collider is clearly in front of the character collider, but the clicks would not register if you clicked it where the character collider was. All under same UIPanel.

Since screen collider is just that, a collider, it had no sprite associated with it or child'ed to it. What ended up fixing my issue is putting a sprite under it and setting the depth of sprite to higher than my depth of character sprite, and just setting colour to transparent. Now my clicks work.

Posting this in case someone else runs into this problem, but wondering if this is expected behaviour. Maybe something to do with using UIEventTrigger?
Title: Re: Obj with collider and event trigger needs sprite to receive click?
Post by: ArenMook on May 14, 2015, 06:06:44 PM
ALT+SHIFT+W creates an invisible widget. ALT+SHIFT+C adds a collider to it. Resize it to desired dimensions, adjust its depth.