1
0
Fork 0

HealthController Update

This commit is contained in:
Triceraptodactyl 2018-04-24 01:28:18 +02:00
parent 6fb48d423d
commit aaf8c48d5a

View file

@ -13,7 +13,7 @@ public class HealthbarController : MonoBehaviour {
{
// if player alive and spawned
if (player != null)
{
{
//Debug.Log(player.GetHealth());
UpdatePointer(player.GetHealth());
}
@ -28,14 +28,13 @@ public class HealthbarController : MonoBehaviour {
float offset;
if (player == null) {
currentRotation = 0;
offset = 0;
offset = -currentRotation;
Debug.Log("Player not found");
} else {
//Debug.Log("calculated offset");
offset = ((playerLife / maxRotation) * 100) - currentRotation;
}
offset /= 10;
gameObject.transform.Rotate(Vector3.forward, offset);
currentRotation += offset;
}