T
TearyLilium
Guest
I'm trying to figure out how to use a PS4 controller for my game. There is an extremely weird thing going on... So if I check for gamepad_is_connected(i) stuff it does recognize that my controller is connected and in the slot 0. If I look into the list of connected controllers, it does say that it is connected and the slot is occupied... But then if I try to have any input it doesn't seem to work?
if (gamepad_button_check(0, gp_face1))
show_message("something");
But.... apparently if I start compiling the game and I hold that gp_face1 button before it finished compiling, it will work at the very first second as the game starts and it keeps triggering it all the time afterwards even if I'm not holding the button anymore. That's why i'm very confused because clearly the controller can be read by gms2 and it recognizes it and the inputs... but it doesn't work like it should work?
also if I create an async system event and put this code in there
var type = async_load[? "event_type"];
var index = async_load[? "pad_index"];
if (type == "gamepad discovered")
{ show_message("Controller connected: " + string(index));
} else
{
show_message("Controller disconnected: " + string(index));
}
at the beginning of the game it says "Controller connected: 0" and then immediately "Controller disconnected: undefined" after that...
So it feels like the controller works the very first moment when the game starts and then it immediately disconnects?
if (gamepad_button_check(0, gp_face1))
show_message("something");
But.... apparently if I start compiling the game and I hold that gp_face1 button before it finished compiling, it will work at the very first second as the game starts and it keeps triggering it all the time afterwards even if I'm not holding the button anymore. That's why i'm very confused because clearly the controller can be read by gms2 and it recognizes it and the inputs... but it doesn't work like it should work?
also if I create an async system event and put this code in there
var type = async_load[? "event_type"];
var index = async_load[? "pad_index"];
if (type == "gamepad discovered")
{ show_message("Controller connected: " + string(index));
} else
{
show_message("Controller disconnected: " + string(index));
}
at the beginning of the game it says "Controller connected: 0" and then immediately "Controller disconnected: undefined" after that...
So it feels like the controller works the very first moment when the game starts and then it immediately disconnects?