Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

2D Button Controls?

Discussion in 'UGUI & TextMesh Pro' started by HaydarLion, Aug 22, 2015.

  1. HaydarLion

    HaydarLion

    Joined:
    Sep 17, 2014
    Posts:
    62
    I have a game where the entire screen in encompassed with two buttons, a left button, and a right button. Using the event system, or some other method, how could i make the buttons move an object to the left or right, depending on which button is clicked?

    The way I have it currently is when the event trigger gets a pointer down a variable for movement is set to true, and when it gets pointer exit the variable is set to false. This works, but takes a second before setting the variable to true, which is devastating to the game, and also when you swipe the variable becomes stuck at true.

    Note: It needs to move the instant the button is pressed.
     
  2. Undertaker-Infinity

    Undertaker-Infinity

    Joined:
    May 2, 2014
    Posts:
    112
    the way you describe it should be instantaneous.
    Post some code maybe?