Search Unity

Using two buttons at the same time.

Discussion in 'Immediate Mode GUI (IMGUI)' started by rjdfhorn2006, Apr 15, 2014.

  1. rjdfhorn2006

    rjdfhorn2006

    Joined:
    Jun 14, 2010
    Posts:
    141
    Is it possible to get multiple touches using UnityGUI? I have arrow buttons that move a rocket launcher and a fire button that fires the rocket. Right now, I can only press one button in order for it to work - if I hold down the arrow buttons I have to let go in order to use the fire button. Any ideas?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    OnGUI code doesn't do multi-touch, so you'd need to use the touch-specific input classes such as Input.GetTouch.

    --Eric
     
  3. rjdfhorn2006

    rjdfhorn2006

    Joined:
    Jun 14, 2010
    Posts:
    141
    Thanks for the quick reply! I managed to figure it out using Input.GetTouch - much easier than I thought it would be.