Hello unityAnswer community I have a question !!!
My question is, how can I pack the variable in its own function so that the two functions still communicate together.
And my script:
function Start(){
var randomnumber = Random.Range(1,4);
if(randomnumber == 1) {
GetComponent("FPSInputController2").enabled = false;
}
if(randomnumber == 2) {
GetComponent("FPSInputController").enabled = false;
}
if(randomnumber == 3) {
GetComponent("FPSInputController2").enabled = false;
}
if(randomnumber == 4) {
GetComponent("FPSInputController").enabled = false;
}
}