I made this script:
private var onoff : boolean = false;
function Update (){
if(Input.GetButtonDown ("Fire1")){
onoff = true;
print("left");
}
if (Input.GetButtonDown("Fire1") && onoff == true){
onoff = false;
print("right");
}
}
but I don’t know why isn’t working, I want it to toggle on and off something.
how can I achieve this ?