MatchThreeGame
MatchThreeGame copied to clipboard
Tries to destroy null game object
MissingReferenceException: The object of type 'GameObject' 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.GameObject.GetComponent[T] () (at C:/buildslave/unity/build/Runtime/Export/GameObject.bindings.cs:28) Utilities+<AnimatePotentialMatches>d__0.MoveNext () (at Assets/Scripts/Utilities.cs:22) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) <CheckPotentialMatches>d__41:MoveNext() (at Assets/Scripts/ShapesManager.cs:530) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Does the error happen on this line?
https://github.com/dgkanatsios/MatchThreeGame/blob/master/Assets/Scripts/Utilities.cs#L22
Have you found out the root cause? Thanks for the report!
I would think you have game objects that are initialised in the wrong order (version sensitivity). I can tell you that when I play the game there are no visible animations. I can't tell you what the root cause is, but probably nothing very complicated for someone who knows their way around the code.
After cloning the project, and updating to 2019.1 I'm also getting this error - adding
foreach (var item in potentialMatches)
{
if(item == null) { continue; }
...
}
Is a working temporary fix - I encountered it after pressing the restart button in your demo scene.