I am getting an NullReference Exception when I am trying to check if a GameObject is null.
public GameObject target;
[...]
if (target != null ) doSomething();
I know that target can be null, so I am checking for null, but this check throws a NullReference Exception…
Any ideas why this is happening?