I cant enable a Object on collisionEnter when its disabled?

Hello i made a script that disables an GameObject onCollisionEnter it works fine but when i try a few meters away to enable the gameObject with jumptutorialbox = GameObject.Find(“TutorialJUMP”);
jumptutorialbox.gameObject.SetActive(true); it gives me an Error

NullReferenceException: Object reference not set to an instance of an object
JumpMessage.OnCollisionEnter (UnityEngine.Collision collision) (at Assets/Scripts/JumpMessage.cs:19)

if you disable the object, you will not find it afterwards via GameObject.Find.

The best way is to store a reference f.e. before deactivating the object, then deactivate it and later when you want to re-enable it you just use that reference.

Try this:

Create an empty game object. Put your “TutorialJUMP” object in it. Then access the empty game object instead of your “TutorialJUMP” object. Since the gameobject has only TutorialJUMP as it’s child, you can reach its transfrom via

exampleGameObject.transform.GetChild(0)

maybe set it to another transform to make things more readable

Transform jumpObj = exampleGameObject.transform.GetChild(0)

and then you can enable the object back with

jumpObj.gameObject.SetActive(true)

hope this helps