• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

I need help with the Up and Down Axis Values!

Liam Earles

Member
Hello! I am trying to code analogue stick controls to simulate the keyboard Up and Down buttons and no matter how hard I try when I test out my project for half of the time, the object always wants to go down. This is the code I have for when the axis value is moved:

Code:
if gamepad_axis_value(0, gp_axislv) > 0
{
          keyboard_key_press(vk_down)
}
And this is the code for when the axis value is released:

Code:
if gamepad_axis_value(0, gp_axislv) > 0
{
          keyboard_key_release(vk_down)
}
I am trying different ways on how to do it, but they don't work the way I want it to work. So comment for help.
 
Top