GameObject.Find not working

Hi I am trying to use GameObject.Find but it doesn’t seem to be working my Object is called Jim

using UnityEngine;
using System.Collections;
public class FloorTrigger : MonoBehaviour {
	public GameObject Jeff;
	void Start () {
		Jeff = GameObject.Find ("Jim"); 
	}
	void OnTriggerEnter (Collider Jim)
	{
		Jeff.GetComponent<PlayerJump> ().enabled = false;
	}
	void OnTriggerStay (Collider Jim)
	{
		Jeff.GetComponent<PlayerJump> ().enabled = true;
	}
	void OnTriggerExit (Collider Jim)
	{
		Jeff.GetComponent<PlayerJump> ().enabled = false;
	}
}

You can already try the following :

void Start ()
{
    Jeff = GameObject.Find ("Jim");
    Debug.Log (Jeff.name, Jeff);
}

When you say that your object is called “Jim”, you mean the object this script is on?
If so, you need to find it.

You can simply use

GetComponent<PlayerJump>()

Also, it seems to me there’s an inconsistency as you disable a component on Enter, to re-enable it on Stay, and disable it again on Exit.

Also, make sure your object bears a Collider component, and that you take it through another Collider object, set as trigger.

In your script GameObject Jeff is public, so you can directly link the Jeff gameObject in your inspector window in the editor and

void Start () 
{
      Jeff = GameObject.Find ("Jim"); 
}

will be useless (unless it’s not already spawn before you play the scene).

also GameObject.Find ("NameOfTheObject"); is a really consuming way to get your component,
prefer to use FindObjectOfType<NameOfAScriptAttachedOnYourObject>(); function.

It’s rather confusing that you have an variable named Jeff which is supposed to have the name “Jim” and then your trigger takes in another collider with a variable named Jim.

From the context it looks like you are trying to turn off Jim’s ability to jump when he’s not on the floor. I’m guessing that Collider Jim is the same GameObject or perhaps a child GameObject of GameObject Jeff. If that’s the case, then you can simplify a bit here:

 using UnityEngine;
 public class FloorTrigger : MonoBehaviour {
     void OnTriggerEnter (Collider Jim)
     {
         Jim.GetComponentInParent<PlayerJump> ().enabled = false;
     }
     void OnTriggerStay (Collider Jim)
     {
         Jim.GetComponentInParent<PlayerJump> ().enabled = true;
     }
     void OnTriggerExit (Collider Jim)
     {
         Jim.GetComponentInParent<PlayerJump> ().enabled = false;
     }
 }

So I changed my script because 2 people suggested about the same thing and my script is below, but I keep getting this same error from the console about ontriggerstay97418-unity-error.png

using UnityEngine;
using System.Collections;
public class FloorTrigger : MonoBehaviour {
	void OnTriggerEnter (Collider Jim)
	{
		Jim.GetComponent<PlayerJump> ().enabled = false;
	}
	void OnTriggerStay (Collider Jim)
	{
		Jim.GetComponent<PlayerJump> ().enabled = true;
	}
	void OnTriggerExit (Collider Jim)
	{
		Jim.GetComponent<PlayerJump> ().enabled = false;
	}
}