Tell a script to auto assign an object.

I have a script… trying to get it to auto assign my “Label” so it works… so i was wondering is there a way to make a c# script Automatically assign the Object with the Specific name.

public UILabel myLabel;

The Gameobjects name is “HealthLabel” no quotes… Can someone help me?

Take a look at GameObject.Find, is this what you want?

public class Example : MonoBehaviour {
   public UILabel myLabel;

   void Start() {
      myLabel = GameObject.Find("HealthLabel").GetComponent<UILabel>();
   }
}