I’m following the Glitch Garden project. The first time around after applying all in the spawners game object, I noticed that only a few lizards were created. I also noticed that I got this error. Now that I’ve applied version control, I’m still getting this same error. I believe the lizard has been destroyed but I might be wrong. I’m putting this in case anyone might know.
MissingReferenceException: The object of type ‘Attacker’ 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.
UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object data, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot) <0x34a00570 + 0x00062> in <5ac29b9d51934dd39a8dce946b9985a7>:0
UnityEngine.Object.Instantiate (UnityEngine.Object original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:211)
UnityEngine.Object.Instantiate[T] (T original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:285)
AttackerSpawner.SpawnAttacker () (at Assets/Scripts/AttackerSpawner.cs:27)
AttackerSpawner+d__4.MoveNext () (at Assets/Scripts/AttackerSpawner.cs:19)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)