Legacy GM Gamepad detection problem

Y

Yvalson

Guest
So I'm trying to add support for gamepads into my game. and I'm currently trying to figure out if my gamepad is getting detected using this code:

Code:
var gp_num = gamepad_get_device_count();
for (var i = 0; i < gp_num; i++;)
   {
   if gamepad_is_connected(i) global.gp[i] = true else global.gp[i] = false;
   }
 
show_message(string(global.gp[0]) + string(global.gp[1]) + string(global.gp[2]) + string(global.gp[3]))
it's the same code as used in this docs:
https://docs.yoyogames.com/source/dadiospice/002_reference/mouse, keyboard and other controls/gamepad input/gamepad_is_connected.html

however when I launched it the game put out this message: 0111
effectively saying there are 3 gamepads connected.
is this correct? or is there something wrong in the code or something?

I disconnected any possible bluetooth device from the phone so that can't be the problem either

the controller i'm using is the PS4 Pro dualshock controller
 
Last edited by a moderator:

jobjorgos

Member
I also tried once to make my controller connect to gamemaker, and I discovered somehow logitech pc controllers where way easyer to connect with my GM game than with a ps4 controller. also ps4 controller dont always connect probly in the most official games that are out on PC is my experience.
Last time I setup a controller to GM was very long ago while it was still GameMaker 8.1, so I dont know what u might have done wrong in this code :(
 
Y

Yvalson

Guest
I also tried once to make my controller connect to gamemaker, and I discovered somehow logitech pc controllers where way easyer to connect with my GM game than with a ps4 controller. also ps4 controller dont always connect probly in the most official games that are out on PC is my experience.
Last time I setup a controller to GM was very long ago while it was still GameMaker 8.1, so I dont know what u might have done wrong in this code :(
I also tried my Ipega controller and it gave the same message it also turns out for some reason the game thinks there are 7 gamepads connected to my phone
 
Top