So..i creating an score and i works, when i kill the enemy it adds +10 to the score,when i get hit it quits 5 points to it, so everything works properly but i have this error all the time,i know my score works properly always but i dont understand why it appears. (Im new,maybe its just a silly error but i really dont know)
Error:
MissingReferenceException: The object of type 'Text' 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.EventSystems.UIBehaviour.IsActive () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/UIBehaviour.cs:22)
UnityEngine.UI.Graphic.SetVerticesDirty () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:100)
UnityEngine.UI.Text.set_text (System.String value) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Text.cs:138)
PlayerController.SetScore () (at Assets/PlayerController.cs:133)
PlayerController.OnBecameInvisible () (at Assets/PlayerController.cs:99)
↧