Twin Stick with Gamepad

0 favourites
  • 5 posts
From the Asset Store
This is a twin stick shooter similar to Enter the gungeon,Nuclear Throne, Helldivers & Soul knight for the mobile device
  • Hello,

    I'm working on a game that needs two stick control. I've looked at videos and other forum topics but haven't been able to figure it out. Here's a link to my c3p file:

    I'm trying to make it so that the aim bar extends when the right thumbstick is moved and retract when it isn't being moved. Right now, it works pretty close to how I want it, but the aim bar retracts between X -25 and 25 when the stick is positioned to the top or bottom. I'm guessing it has something to do with the deadzone but I can't figure it out.

    Thanks,

    Alec

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is no link in your post.

    Check the deadzone setting in Gamepad object properties (on the left panel).

  • Sorry about that, here's the link: https://drive.google.com/file/d/1iktm9atfwHJzVwJEgyqBs2rrqiVLlGxq/view?usp=sharing

    I have the deadzone at 0 and am kind of just doing the deadzone with events. I think I saw a thread where people were doing that.

    If I disable the events that turn the aim's width to zero, it all works as intended, but just doesn't go back to zero when the thumbstick is released. I guess the main thing I need to figure out is a way for it to know that there is no input on the the thumb stick, but in a way that doesn't interfere with the aiming event. If that makes sense.

    I've tried out the twin stick example and the one that dop2000 made here (https://www.construct.net/en/forum/construct-3/how-do-i-8/top-down-twin-stick-shooter-131848). I'm sure they both work, but for some reason they haven't on my computer. In the Construct one I can only shoot left and right and in dop's I can only aim downward. I saw someone in the thread saying that it worked for them on firefox but it still didn't work on my computer. I've unplugged my controller and tried a different one, but for some reason they aren't recognizing the input from those even though my computer is in properties.

    Sorry that was kind of a lot. I haven't worked with the gamepad before. There's probably some trick to getting them to work consistently.

  • Your example works for me, but I had to change the expression to this:

    angle(0, 0, Gamepad.Axis(0, 2), Gamepad.Axis(0, 3))

    I think axes 0 and 1 are for the left stick, and axes 2 and 3 are for the right.

  • Thanks. I gave that a shot and for some reason now I can only aim left and right like in Construct's example. The 3 axes only reads out at 0. I guess maybe it's just my controller.

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