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:
- only one gameObject(Player_1) moves.
- ONLY on the x axis (only left and
right).
Please help.
Can you post some scripts, when you're tapping on joystick pad ?
– sriram90Am not sure what's going on because of i dont have unity right now. Try to change your ForceMode, Because ForceMode.Force Adds continious force on rigidbody using mass. Try with acceleration force mode.
– sriram90Can you post a screenshot of your input setup? The problem could be that deadzones and input types could be mismatched.
– TykoX64I ran a Debug.Log(_moveHorizontal) and Debug.Log(_moveVertical). For no apparent reason, the values are 0.0107 and 0.0107...even if I'm not touching the gamepad at all. The input manager is set up just as I wrote in my question, but I'm adding the screenshots anyway...
– PaxForceIs Unity such a f-ed up game engine??? Somebody help me!!! I'm really losing i it!
– PaxForce