Problems assigning Horizontal input for multiple players

Hi,
I have two player objects each with its own script. Within the Player1 script I am checking for horizontal input:

        float horizontal = Input.GetAxis ("P1Horizontal");
        rb2d.velocity = new Vector2 (horizontal * maxSpeed,rb2d.velocity.y);

In the script for Player2 I am also checking but for another Input name:

        float horizontal2 = Input.GetAxis ("Horizontal");
        rb2d.velocity = new Vector2 (horizontal2 * maxSpeed,rb2d.velocity.y);

(Note: The names I chose are rather inconsistent :smile:)

I also have those two names in the InputManager, see InputManager.png attached.

Somehow only one of the player objects is moving. Where to look for ther problem. It seems to me that they are still both getting their axes from “Horizontal”? I am pretty new to Unity so it might be something very obvious :slight_smile:

Thanks in advance.

Hi KaeseBrot,

I made a similar input manager setup as yours, and didn’t have any issue of getting different input from both “P1Horizontal” and “Horizontal”. The problem might laid somewhere else. Care to share more detail?