- Home /
This question was
closed Jun 27, 2014 at 11:58 AM by
Graham-Dunnett for the following reason:
Duplicate Question
Question by
Moose54 · Jun 27, 2014 at 11:56 AM ·
errorgameobjectobjectnullreferenceexception
NullReferenceException
"NullReferenceException: Object reference not set to an instance of an object ObjectDetect2.OnDisable () "
How do I resolve the error?
function OnEnable() {
var gameController = GameObject.FindWithTag("EditorOnly");
gameController.SendMessage("OnEnableObjective");
}
function OnDisable() {
var gameController = GameObject.FindWithTag("EditorOnly");
gameController.SendMessage("OnDisableObjective");
}
other script
function OnEnableObjective() {
objectives++;
}
function OnDisableObjective() {
objectives--;
if (objectives == 0)
SendMessage("OnObjectives");
}
Comment
There are around 700 questioned tagged with nullreferenceexception.
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Error when player trying to take damage from a hazard 0 Answers
NullReferenceException 1 Answer