// Use this for initialization private void Start() { // Find the player reference when the game starts m_Player = FindObjectOfType <PlayerController_Example>(); // Update UI to whatever values we have at start UpdateUI(); }
void Awake() { //Find the Player, and if found, get the Waypoint Controller //There are better ways to accomplish this, but this is probably the simplest GameObject player = GameObject.FindWithTag("Player"); if (player != null) { playerController = player.GetComponent <PlayerController_Example>(); } }