Xbox One controller not working for me on Xbox One UWP game

How do I get the Xbox One controller to work, on my Xbox One project made in Unity?

I’m using the UWP stuff to get it onto the Xbox, and that’s all working now.

But then, my game doesn’t do anything.

Oddly, my Main Menu, which says “Press any button” DOES work, you can proceed past that. But then, none of the controls in-game work.

The main menu detects any button with this code…

void Update () {

	if (Input.anyKey){ 

         Application.LoadLevel (1);

	}

But the controls inside the game are using the Input Manager, and it’s a 4 player game, so things are mapped to Joystick 1, 2, 3, 4.

Is there an issue with doing that?

Any general tips and tricks for a first time Xbox One developer? :slight_smile:

THANKS!

In short, from my experience so far, the built in Unity Input Manager is not cross platform compatible with the Xbox One. I am now using InControl (the Unity Asset Store package), and that has let me build a character controller that actually works on Xbox One using an Xbox One controller. So I'm going to build my character controllers all using InControl in future, as it seems to be really cool. And it's a good experience for me anyway, to build my own character controller, head bob, etc.

2 Answers

2

If it detects anyKey, then your controller is connected.

You are more likely missing correct mapping.

Please use this mapping for your Xbox One Controller:


I’m updating the answer to clarify that Xbox One Controller and Xbox 360 Controller have different input schemes.

Xbox 360 Controller:
alt text

Xbox One Controller:

So you’ll have to get controller name from Input.GetJoystickNames() to know if it is a Xbox One Controller or Xbox 360 Controller, and set correct input layout for your game.

That seems to be the Mac OS mapping for the Xbox One controller. I think the Windows one looks like this, and it may have changed so that the Trigger controllers used to be a "shared Axis 3" (the same as the Xbox 360 controller), but has perhaps been updated to now be a separate LT Axis 3, and RT Axis, or something... https://forum.unity.com/attachments/ctrlmapping-png.182522/ That "Input.GetJoystickNames()" sounds useful, I haven't used that before. Thanks.

Thank you.

For clarification… have you tried out the Xbox One controller on a game running on the Xbox One?

It seems to all work fine on Windows, but have you run a game on Xbox One itself, using the Input Manager?

Cheers!

Hi muzboz, If you can convert your answer to comment that would be great. I have an Xbox One Controller that I used both on Windows 10 and Xbox One. It works on both, and I use my controller to test my game on Windows. I haven't developed any game on Xbox yet so I'm not sure, but input manager is supposed to be cross platform.