- Home /
One Xbox Controller Is Affecting All Players
I have the following code in my Update
method, and when I use my controller, It affects all characters for some reason and I am not sure what is wrong. When I press the A button on the controller only the first player 1
should be affected.
PlayerID:
[Range(1,4)]
public int playerID = 1;
If statement in update:
if(Input.GetButton("Select Character " + playerID) && !selected){
selected = true;
rigidbody.AddForce(Vector3.up * 40f, ForceMode.Impulse);
currentChar.GetComponent<Animator>().SetBool("Cast Spell", true);
}
Here are my input settings for players 1 and 2
And here are my input settings for players 3 and 4
Can anyone see what is causing this to happen?
Answer by skylem · Feb 21, 2015 at 05:00 PM
in the positive button field of your input for select character you can assign the button press to the corresponding joystick just change what you have joystick button 0 to joystick 1 button 0 etc hope this fixes your problem.
Well.... There we go! I forgot that I can do that. Do I even need Joy Num?
Honestly i can't remember it has been a long time since i experimented with gamepads, i suggest trying it without and see if it breaks ur functionality, if it does not it's probably safe to assume u don't need it.