MissingReferenceException when reloading level
I'm trying to implement a simple restart action for the current level in my game, thought this should be no problem but when I restart the level, I'm getting hundrets of missingreference exceptions and the game doesn't work anymore. It seems to be primarily in this line: return transform.position + (offset); The game sets the position of every actor at the start, so it is required that the transform can be accessed. I don't really understand why this doesn't work. Also, when I'm trying to access the gameObject for debugging purposes like print((gameObject == null)); Unity just freezes and I have to kill the process. Transitions to different levels seem to work properly. Any ideas?
how do you restart the level? does a null check on the transform also freeze the editor? are you using your own transform and gameobject variables?
Your answer
Follow this Question
Related Questions
Reload only when not firing 1 Answer
[Unity Beginner] Game design question on scene loading and scene transitioning 0 Answers
Why is my scene not loading? 2 Answers
changing scene not working? 0 Answers
How do I use 3 scenes (menu and 2 maps) while only leaving the current scene and menu active? 0 Answers