How do I have two way joy-stick?

From the Asset Store
5 Types of Touch Buttons containing 90 touch buttons from D-Pads to Touch Joy Sticks and more.
  • How do I make an analog stick that only goes up and down? It would be used to control gun angle.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can do this by assigning events to the Joystick's Y axis only.

    For example:

    Right analog Y axis < 50 ---> Set gun angle -10 pixels

    Right analog Y axis > 50 ---> Set gun angle +10 pixels

    (I made the numbers up, you'd have to test and tweak it to get it behaving the way you like, and maybe swap the conditions / events round if you wanted inverted gun control or not). Not sure what method you are using to angle your gun so just modify that part of the code to make sense for your game engine.

    I set the analog deadzone to 50 because I hate twitchy analog sticks, I think it's nice to have the stick only register input when the player has pushed it at least 50% off kilter, but of course change that if it's not right for you

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)