Hello, I was writing some simple code then I went through something strange…
My unity editor crashes just if I enter play mode with the 2 incriminated lines in void Update(), that I’ve signed as a comment, are active. Why should a simple do while making unity crash?
I’ve even tried other forms like while (!Ewall) but nothing changes.
Any kind of help would be appreciated, thank you.
bool Ewall=false;
void Start(){
}
void Update ()
{
var dir = Vector3.zero;
if (Input.GetKey (KeyCode.UpArrow))
dir = Vector3.forward;
if (Input.GetKey (KeyCode.DownArrow))
dir = Vector3.back;
if (Input.GetKey (KeyCode.LeftArrow))
dir = Vector3.left;
//do {
if (Input.GetKey (KeyCode.RightArrow))
dir = Vector3.right;
//} while(Ewall==false);
if (dir != Vector3.zero && !isTumbling) {
StartCoroutine (Tumble (dir));
}
}
void OnTriggerEnter(Collider other){
if (other.gameObject.CompareTag ("Ewall")) {
Ewall = true;
Debug.Log ("EastWall!");
}
}
}