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

Unity keeps crashing when 'While' is used...

$
0
0
Hello, My script is very simple : once the character stops moving, the camera background will change. I don't know why, every time I start the Play mode, Unity crashes. Here's my script (C#) : using System.Collections; using System.Collections.Generic; using UnityEngine; public class cameraBackground : MonoBehaviour { public Color black = Color.black; public Camera cam; public GameObject character; // Use this for initialization void Start () { cam = GetComponent(); } // Update is called once per frame void Update () { while(character.GetComponent().enabled == false){ cam.backgroundColor = black; } } } Any help would be appreciated. Thank you and sorry for my English.

Viewing all articles
Browse latest Browse all 2383

Trending Articles



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