diff --git a/Assets/Scripts/Orbs/RestoreHealthOrbs.cs b/Assets/Scripts/Orbs/RestoreHealthOrbs.cs index 150264c5720a6ee69ef5838dbc608b0b865aaf10..b3a72dab180a1e8c05a6cc8a7d9967f97c1b5a6c 100644 --- a/Assets/Scripts/Orbs/RestoreHealthOrbs.cs +++ b/Assets/Scripts/Orbs/RestoreHealthOrbs.cs @@ -2,14 +2,17 @@ using Nightmare; using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.UI; public class RestoreHealthOrbs : Orbs { PlayerHealth playerHealth; + Slider healthSlider; public override void Start() { playerHealth = GameObject.Find("Player").GetComponent<PlayerHealth>(); + healthSlider = GameObject.Find("HealthSlider").GetComponent<Slider>(); // Destroy object after 5 seconds Destroy(gameObject, 5f); @@ -23,6 +26,9 @@ public class RestoreHealthOrbs : Orbs playerHealth.currentHealth = 100; } + // Set Health Slider + healthSlider.value = playerHealth.currentHealth; + // Destroy the orb Destroy(gameObject); }