public void Update() { if (GetAlive()) { healthBar.SetHealthPercent((healthNow * 100 / maxHealth)); healthBar.gameObject.SetActive(isSelected); VRPlayerIndicator player = null; foreach (GameObject plays in GameObject.FindGameObjectsWithTag("Player")) { VRPlayerIndicator ind = plays.GetComponent <VRPlayerIndicator>(); if (ind.GetPlayerNumber() == GetOwner()) { player = ind; } } VRHeadTracking head = player.GetComponent <VRHeadTracking>(); healthBar.transform.LookAt(head.GetHead().transform); } else { healthBar.gameObject.SetActive(false); StartCoroutine(Dies()); } }