Two player controls using GetAxisRaw?

So I’m using the same movement script for a two-player cube fighting 2d game

I’m trying to move my players using Input.GetAxisRaw(“Horizontal”) and can’t seem to find a way to make a sort of “Horizontal2” axis for player2 to move on its own axis, without having the movement controls carry over to both players at the same time.

I tried to remap the project settings by renaming a second horizontal axis Horizontal2 and changing the negative key to “left” and the positive key to “right”.

IF anyone can help me that’d be much appreciated; thank you.

Did you remove the alternative buttons on both the “Horizontal” and “Horizontal2” axis in the input manager? Because the default Horizontal axis uses left and right arrows for the normal positive and negative buttons but also uses “A & D” as alternative buttons.

So try and setup your “Horizontal” axis to use left and right arrows for the negative and positive buttons, and remove the “A & D” from the alternative buttons.
And with “Horizontal2” use the “A & D” buttons and remove the alternative buttons.

1 Like