Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity gamemanager instance not set to an instance of an object

It seems your singleton GameManager has no instance.

1) Did you forget to attach your Component (GameManager) to any object in hierarchy?

2) In you GameManager script, did you assign a value for instance in the Awake function (not in Start function)?

 void Awake () { instance = this; } 

3) Is the object in hierarchy which holds the GameManager component active?

4) Are there any other scripts in scene that before running require GameManager to be already set up? If yes, consider defining an "Execution Order" in Edit > Project Settings > Script Execution Order.
 
PREVIOUS NEXT
Tagged: #unity #gamemanager #instance #set #instance #object
ADD COMMENT
Topic
Name
2+6 =