Hi Community, Im Learning Boolean’s. And Im trying to get the LookAt to toggle Off, Ive Got first bit right I think, but not sure to put at the bottom. thanks in Advance
#pragma strict
var toggle : boolean;
var target : Transform;
function Start () {
}
function Update () {
if (Input.GetButtonDown("Fire1"))
toggle = !toggle;
if (toggle){
print("Toggled ON");
transform.LookAt(target);
}
else
if (Input.GetButtonUp("Fire1")){
if (!toggle){
print("Toggled OFF");
}
}
}