[Solved] My game crashes when I read the gamepad type

Hello, my game freezes when I read the type of gamepad. I tried a lot of original ps4 and xbox controllers and non of them work I also tried to run the game in different os.
This is the event that freezes the game:


Please describe your setup: OS, version of GDevelop, gamepad model, connection, etc.

You can try to remove the gamepad condition to check if it’s causing the freeze. And if it’s still freezing, remove the modify text action to confirm it is the culprit.

Also, you can open the gamepad example project and check if it works fine for you.

Hi, the example works and the modify text function is what crashes the game.
My setup:
OS: Pop OS (Linux)
Gamepad: Original ps4 controller and an xbox one certificated controller
EDIT: I use Pop OS as my main OS however I tried the game on windows 10 too

OK. Can you take the expression you’re using inside the text action, and use it in the example project ?
That way, we should know if your project is the issue, or if that specific expression is somehow broken.

Hi I found the problem using the example project. The game detects the controller as the second controller. But I don’t have any other controllers connected at the same time and I tried this in a lot of computers so I guess that’s also a bug
Have a good day

If the gamepad is detected as second controller, the condition is false, so the action shouldn’t be executed. :thinking:
I don’t have gamepads to check. :man_shrugging:

1 Like

I’ve found a bug in this expression for get the type, i’ll fix it in few hours.
You will be able to update the extension gamepad after.

If you can try to replace the extension by this new version with the fix let me know.
Gamepad with fix on get type exp - v 0.0.8

Sure thing. I’ll try the patch tomorrow and keep you informed.
Thanks for fixing the bug. Have a good day

Hi, I noticed that you deleted the file recently. I already have it in my computer is there any problem with it?

It’s all right, I set a short time before deleting the file, it’s my fault.
Here a new link

Ok, Thanks I’ll try that patch today.

The game still recognizes the 1st controller as the 2nd one for some reason. However now I can get the type of controller without a problem.
Thanks. (The controller getting recognized as the second one isn’t a big deal I was just letting you know)
Have a good day

The update of the fix has been published for everyone (0.0.8) in the extension manager inside GDevelop.
Thanks for your feedback!

About the controller that is detected as second, I checked in the extension there is no bug and I did not manage to reproduce the problem.

A virtual controller or driver could use a gamepad port and therefore use slot 1 I guess.