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

why is my script crashing unity?

$
0
0
I am currently working on a project on school and have been loosely following an old YouTube tutorial. however my unity keeps crashing . it seems that this code is the issue. could anyone help me with this please? using System.Collections; using System.Collections.Generic; using UnityEngine; public class DisplayScene : MonoBehaviour { public int Scene; public int scene { get { return scene; } set { scene = value; // although it is unecessary to define this i have added it so i can see what i have done if (value == 3) scene = 1; else if (value == 0) scene = 2; else scene = value; } } private int previousScene; void Start() { previousScene = 0; scene = 1; } void update() { if(scene != previousScene) { GetComponent().sprite = Resources.Load("Sprites/scene" + Scene.ToString()); } previousScene = scene; } }

Viewing all articles
Browse latest Browse all 2383

Trending Articles



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