Multiple Joysticks activating both scripts
I honestly am stumped by this. Using C# code, I set it up so each game object has an ID determined at their creation, I made it so each can move without the other, but when I push button 0 on either joystick they attack instantly. I edited input settings, changed the name for each input, made it so if one character has on ID it will only receive that button, made it so one input requires Joystick one and the other requires Joystick 2, but it still does the same thing. Basically, here's what I typed.
if (playerID == 1)
{
x = Input.GetAxis("P1Horizontal");
y = Input.GetAxis("P1Vertical");
If (Input.GetButton("P1Attack"))
{
Attack();
}
} else if (playerID == 2)
{
x = Input.GetAxis("P2Horizontal");
y = Input.GetAxis("P2Vertical");
if (Input.GetButton("P2Attack"))
{
Attack();
}
}
//And then later I made it so the Rigid Body moves with the x and y.
As mentioned earlier, P1Attack and P2Attack are set to different joysticks, both on joystick button 0 but set so P1Attack's only receiving Joystick 1 and P2Attack's only receiving Joystick 2. I'm gonna try something, and if it works I'll post it and mark this as solved, but for now, any help would be apprecieated.