Weird Input Manager behaviour

alt textI’ve created a simple multiplayer game and now I’m trying to set up my two gamepads.
This is how my input manager looks like:

Axes

  • Name: Horizontal_P1
  • Type: Joystick
  • Axis: X axis
  • JoyNum: Joistick 1

  • Name: Vertical_P1
  • Type: Joystick Axis
  • Axis: Y axis
  • JoyNum: Joistick 1

  • Name: Horizontal_P2
  • Type: Joystick Axis
  • Axis: X axis
  • JoyNum: Joistick 2

  • Name: Vertical_P2
  • Type: Joystick Axis
  • Axis: Y axis
  • JoyNum: Joistick 2

Here’s a bit of my code from the Player_1 script:

void FixedUpdate()
	{
		float _moveHorizontal = Input.GetAxis ("Horizontal_P1");
		float _moveVertical = Input.GetAxis ("Vertical_P1");
		
		Vector3 _movement = new Vector3(_moveHorizontal, 0.0f, _moveVertical);
		
		rigidbody.AddForce (_movement * _movementSpeed, ForceMode.Force);
	}

All the player gameObjects have a similar script attached.

And here come the problems:

  1. only one gameObject(Player_1) moves.
  2. ONLY on the x axis (only left and
    right).

Please help.

So the solution was to up the answer was to up the dead value for your gamepad input so that the smaller values were ignored since the gamepad joysticks almost never reset back to exact 0.

Second is to make sure what axis your gamepad is using, the default unity gamepad controls are set up for the Xbox 360 controller. The actual gamepad you are using may have funky button and axis setups. I’m not sure what the best way to find out exactly what buttons and axes do what in unity. If anyone knows a better way than just trying every possibility I’d love to know.