Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Unity crashes when executing a script onMouseDown

$
0
0
So I have a green button, that when I press it, the door goes down and closes. Here is my script that is attached to the button. using UnityEngine; using System.Collections; public class DoorButtonLeft : MonoBehaviour { public GameObject doorleft; public float closeSpeed =3f; void OnMouseDown () { while (doorleft.transform.position.y != 4.322434) { doorleft.transform.Translate (Vector3.down * closeSpeed * Time.deltaTime); } } } All it does is crash my unity. Please help.

Viewing all articles
Browse latest Browse all 2383

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>