Here’s the error I’ve been trying to fix for a bit now:
Blockquote
MissingReferenceException: The object of type ‘AttackerSpawner’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
Shooter.IsAttackerAheadInLane () (at Assets/Scripts/Shooter.cs:45)
Shooter.Update () (at Assets/Scripts/Shooter.cs:72)
The errors occur per instance of Defender after Attacker instances are destroyed in their lane. Most Defender instances aren’t changing their animation state from attacking to idle, but some are. I thought the animation state part of the error was an animation bug similar to what Ben had, so I went and redone the transitions with a new boolean variable name, but to no avail.
Lines 45 and 72 the console mentions are the same as in the example, just different variable names.
So far I’ve tried implementing null checks in the Shooter script, used ‘this’ in the Health script for destroying gameObjects, and commented out my code and pasted Ben’s code, still no luck