NullReferenceException (shooter script)

Hello,

When I disable lanes 1,2 and 5. Whenever I place a cactus in lane 4 the following bug appears:

NullReferenceException: Object reference not set to an instance of an object
Shooter.IsAttackerInLane () (at Assets/Scripts/Shooter.cs:60)
Shooter.Update () (at Assets/Scripts/Shooter.cs:35)

I went through the code and it should be fine, not sure why it appears now when I disable the three other spawners.

Regards,
Waleed

Hi Waleed,

Each defender needs to find a spawner in their lane. Otherwise, you’ll get a NullReferenceException.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms