Gamepad Values Problem

Imperial

Member
Hello

so this is my script
Code:
Key_Vertical = gamepad_axis_value(global.gamepad_index,gp_axisrv);
when I print the Key_Vertical variable It only returns 0 and 1

and It should return -1 and 0 and 1

How to Fix this please
 
T

Taddio

Guest
Code:
Key_Vertical = gamepad_axis_value(global.gamepad_index,gp_axisrv);
when I print the Key_Vertical variable It only returns 0 and

and It should return -1 and 0 and 1
It actually should return ANYTHIBG BETWEEN -1 and 1, depending on how far you pushed your joystick.
Are you sure global.gamepad_index refers to 0 (controller 1)?
To my eyes, your bit of code should work...
 

Imperial

Member
It actually should return ANYTHIBG BETWEEN -1 and 1, depending on how far you pushed your joystick.
Are you sure global.gamepad_index refers to 0 (controller 1)?
To my eyes, your bit of code should work...
Code:
for(i = 0; i < gamepad_get_device_count(); i++)
{
    if(gamepad_is_connected(i))
    {
        global.gamepad_index = i;
    }
}
 

TheouAegis

Member
Did you test your controller in other programs to make sure it's not broken?
What did you set the threshold to for your controller in Game Maker? Did you set a threshold?
Are you sure you pushed UP on the right analog and DOWN on the right analog?
Are you sure the constant in GM is not pointing to the wrong input on your controller?
 
Top