I’m working on a splitscreen game which is coming along okay - I have four different 360 controllers and they can all move around etc no problem.
But when I’m check for a button, at least in this case button 7 (start), any controller pressing start will trip the GetButton for all joysticks.
I’ve created four separate entries in the input manager, and specifically assigned the controller number to each. But it doesn’t seem to matter which one presses start, they all show up as pressing start for every controller.
Attached is a screenshot of the input settings (shows two buttons).
Also here is the code for create the player objects - it works, it just creates all four players no matter which one pressed start:
#pragma strict
private var player1:GameObject;
private var player2:GameObject;
private var player3:GameObject;
private var player4:GameObject;
public var playerGO:GameObject;
function Start () {
}
function Update () {
if (Input.GetButton("C1Start")){
if (player1==null){
player1=Instantiate(playerGO,transform.position,transform.rotation);
player1.GetComponent(FPSControl360).playerNo=1;
}
}
if (Input.GetButton("C2Start")){
if (player2==null){
player2=Instantiate(playerGO,transform.position,transform.rotation);
player2.GetComponent(FPSControl360).playerNo=2;
}
}
if (Input.GetButton("C3Start")){
if (player3==null){
player3=Instantiate(playerGO,transform.position,transform.rotation);
player3.GetComponent(FPSControl360).playerNo=3;
}
}
if (Input.GetButton("C4Start")){
if (player4==null){
player4=Instantiate(playerGO,transform.position,transform.rotation);
player4.GetComponent(FPSControl360).playerNo=4;
}
}
}