From aaf8c48d5a1723a412e5ab150ef127636e16e1b1 Mon Sep 17 00:00:00 2001 From: Triceraptodactyl Date: Tue, 24 Apr 2018 01:28:18 +0200 Subject: [PATCH] HealthController Update --- Assets/Scripts/HealthbarController.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/HealthbarController.cs b/Assets/Scripts/HealthbarController.cs index a525518..876bffe 100644 --- a/Assets/Scripts/HealthbarController.cs +++ b/Assets/Scripts/HealthbarController.cs @@ -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; }