hello everyone, i’m new with Unity 2d and i have an issue
When i reload the scene by itself, it continuously appears this error:
MissingReferenceException: The object of type 'SpriteRenderer' has been destroyed but you are still trying to access it.
I tried to use DontDestroyOnReload
but it makes my project hanged
Can someone give me any solutions?
its appear coz the sprite which is you access in script is destroy during game start u need to get this sprite in start method of the script
CardDatabase.cs
references a SpriteRenderer
at line 28. MissingReferenceException
error means that this SpriteRenderer
became destroyed already (sb called Destroy()
on this gameObject) and cannot be accessed anymore.