How to tell if player uses playstation or xbox controller with events?

0 favourites
  • 3 posts
From the Asset Store
Small pixel icons for the 3 most popular controller types.
  • So I'm making a car game and I'm almost done with it but I have come to a problem. Basically in my game there is gamepad (controller) support and when the game detects you are using gamepad a ui comes up with what buttons do what. The thing is this ui uses art that resembles the xbox controller buttons x a y b and I want it to make it so when using ps controller it changes the frame of animation of this ui. How come there is no event in the gamepad object type that says "is player on ps controller" or "is player on xbox controller" because I kinda need this so if using ps controller it changes the frame of animation in the ui to look like ps buttons and not just xbox. Any way to do this?

  • I believe your best bet is to have a user togglable setting.

    To work on Windows, Playstation controllers generally use an xinput wrapper, so as far as the system can tell you're using an xbox controller.

    This is true for all commercial games on PC I've seen myself, none were able to detect that I was using a dualshock automatically and default to showing XBOX tooltips.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Try looking at what the GamepadID expression returns when connecting different types of controllers. Mind that these strings will not be just be "Xbox" or "PS4". Likely they will be more cryptic, but if you connect different types of controllers you should be able to find a pattern.

    Ideally try connecting as many different types as possible, Xbox 360, Xbox One, Series S, Series X, PS2, PS3, PS5 anything you can get your hands on. Likely wired and wireless will yield different results. If you do that you will be able to better handle what ever is connected.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)