Gamepad Axis Deadzone

0 favourites
  • 5 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • I'm using the gamepad axis to aim (based on angle(0, 0, Gamepad.Axis(0, 0), Gamepad.Axis(0, 1)). However, when the stick is returned to the middle, the axis is set to 0 instead of leaving it at the previous axis. Is there a way to stop this from happening?

  • I'm beginning to think this is impossible utilizing the gamepad object - there has to be a way to outsmart the plug-in into sending the angle and keeping said angle before hitting the deadzone.

    I've tried creating a global variable and setting so if the gamepad x & y axis are > 25 (deadzone), set global variable to angle(gamepadaxis). Then then another event that states if the x & y axis are < 25, set angle(gamepadaxis) to global variable. But, of course, to no avail.

    Anyone have any out-of-the-box suggestions?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've been trying to figure this out as well, haven't come up with anything.

  • Haha, actually I figured it out like 10 minutes after I posted that... Just had one thing wrong. We were both trying similar approaches.

    If the angle of the Gamepad analog axis is outside the deadzone, store that angle in a variable on the object. Every Tick, rotate the object toward that variable, instead of the active angle. This way the variable will only be stored if its outside the dead zone, and not return to zero.

    I'm sure there's a more optimized solution, but this is working at the moment.

  • Click the Gamepad Object on the object list, and on the properties window there's an option for setting the deadzone! IIRC the default is 30.

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