MissingReferenceException: (622716)

I pause the gameplay scene and go to main menu scene but when i go back to gameplay scene again i get this error :

MissingReferenceException: The object of type ‘RecycleGameObject’ 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.
ObjectPool.NextObject (Vector3 pos) (at Assets/Scripts/ObjectPool.cs:26)
GameObjectUtil.Instantiate (UnityEngine.GameObject prefab, Vector3 pos) (at Assets/Scripts/GameObjectUtil.cs:15)
GameManager.ResetGame () (at Assets/Scripts/GameManager.cs:83)
GameManager.Update () (at Assets/Scripts/GameManager.cs:42)
please help me.

Attach the whole script. Only then people will be able to find the problem.
This could be fixed very easy if the whole script is shared.

1 Like

The error tells you what the problem is, a gameobject you are trying to use has been destroyed… first debug step is to find where you destroy the gameobject in your code, then work through the logic flow and figure out where you’ve made a mistake in it.

1 Like

thanks .