Beispiel #1
0
 void Start()
 {
     hp = GameObject.Find("HPtext").GetComponent <HP_Con>(); // find gameobject "HPtext" and access HP_Con component
 }
Beispiel #2
0
 void Start()
 {
     Player = GameObject.FindGameObjectWithTag("Player").transform; // find gameobject with tag "Player" and access transform
     hp     = GameObject.Find("HPtext").GetComponent <HP_Con>();    // find "HPtext" and access HP_Con component
 }