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!

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.

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!