Hello!
I am trying to do a virtual joystick and i was using a script in my camera(it was working well) but now i want to implement the NGUI interface.
This is what i was using :
RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.GetTouch(i).position),Vector2.zero);
if(hit.collider != null) {
if (hit.collider.name == "Button_Left")
{
//the character move to left
}
..........
I want to know how can i verify if a touch position is colliding a specific object. I have tested in many different ways using the "UIEventListener". The "On Hover Over" option doesn't work well because when i click out of the collider and snap the touch position into the collider it dont trigger. The "On Hover Over" option only trigger when i click first inside the collider area.
I have trying in diferent ways, combining OnPress, OnDrag, Hover.... But dont work as i want. I only want to know the information "if (have a touch position on the button)".
Buttons that use "OnPress" to trigger, like "Jump Event" worked well, but the directional buttons dont...

If anyone understand what i want to do and make it clear for me, i would be grateful!