I’ve been following Rick’s code line by line and I’m getting 2 null pointer exceptions anyway.
If I have all defender objects removed from the scene, I can place only one cactus and no more cactuses or trophys at all - if I try, I’ll get this:
Object reference not set to an instance of an object
DefenderSpawner.AttemptToPlaceDefenderAt (UnityEngine.Vector2 gridPos) which is here:
I’m getting this exception whether I have selected a defender from the defender menu or not.
If I do have a defender game object in the scene, as soon as I start the gameplay and the first attacker spawner spawns an attacker there’s anothe exception: “Object reference not set to an instance of an object Shooter.IsAttackerInLane ()” which is here:
I’ve been breaking my weak brain for the 2nd day with that and I’m stuck. I can’t figure out where my object reference is not set to an instance of an object. Is that the problem in the code or something is messed up in the Inspector?