- Home /
 
 
               Question by 
               PERFKNIGHT · Jun 12, 2017 at 09:13 AM · 
                crashgame  
              
 
              Game crashing on startup?
I'm trying to make a game with progressing dialogue. Here's the script I'm using that seems to be causing the problem.
 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
 public class CutsceneCtrl1 : MonoBehaviour {
 
     private Text dialogueText;
     private float delay = 5;
     public string[] lines; 
     private bool isFinished;
     
 
     void Start ()
     {
         dialogueText = GetComponent<Text>();
         dialogueText.text = "";
         isFinished = false;
 
     }
 
     void Update()
     {
         foreach (string line in lines)
         {
             dialogueText.text = line;
             while (!isFinished)
             {
                 if (Time.time >= delay)
                 {
                     isFinished = true;
                     delay = Time.time + delay;
                 }
             }
             isFinished = false;
         }
     }
 
 }
 
               Thing is, the game keeps crashing whenever I try and run it. Not sure where the problem is.
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Game Crashes On Startup? 3 Answers
Troubleshoot a Browser Based Game Crash 1 Answer
Game keeps locking up "deleted gameObject" in hierarchy 0 Answers
gamecrashes while being loaded 0 Answers
Device reboot in Android - Unity 3.5.3f3 3 Answers