I have a 2 player game and each player has their own script with their own button and joystick names. E.g the PS3’s triangle button in the code and Edit-Input manager is “PS3_Triangle” and the 360’s Y button is “X360_Y” in the code and Edit-Input Manager. The joysticks work fine with only the 360 controller moving only the first player and the PS3 controller moving only the second player. Now the buttons are EXTREMELY annoying for me. The Y button is supposed to jump only for the first player and the Triangle button only on the second player, but for some reason the Y button and Triangle button control both players (well actually all the buttons control the other player as well.) I want a way that only the Y button on the 360 controller jumps only for player 1 and the Triangle button jumps only for player 2. In the Input Manager, the positive button slot, I have it named “joystick button 3” for the Y button on 360 with the Joy Num set to Joystick 1 and the slot named “joystick 0” for the Triangle button on PS3 with the Joy Num set to Joystick 2. Each player’s script calls for the button that’s supposed to do an action but for some reason the other controller’s button can do the same for it. Would the problem be in Input Manager or in my code? I doubt that it’s my code because the joysticks only move the player that their supposed to move. I could really use some help since I’m a sophomore in highschool and we’re barely starting Unity this year. I’m not sure if this helps, but the name for the Y button is “X360_Y” and the name for the Triangle button is “PS3_Triangle” and that’s what the script references. Below is a sample of the script for the RB button 360 controller. The script is C#
if (Input.GetButtonDown(“X360_A”) && aim == true)
{
svumode = 2;// animation mode
camera1.GetComponent().fieldOfView = 60;// camera depth = 60
aim = false;
GameSettings.Sens = 10;//mouse sensitivity = 1
}
the script posted above is for the 360 controller. The one for PS3 buttons just says what I named them. Please help me with this problem. I will be as clear as possible.thanks