Keep Away logic finalized and UI polished up

One animation bug found when player picks up hat (possibly when jumping)
This commit is contained in:
djkellerman
2025-03-28 22:50:33 -04:00
parent 2913d4b927
commit c7b1e55a3e
8 changed files with 478 additions and 30 deletions

View File

@@ -96,12 +96,17 @@ public class Damageable : MonoBehaviour
{
if (GameManager.Instance != null)
{
GetComponent<UseItem>().DropItem();
UseItem useItem = GetComponent<UseItem>();
if (useItem != null)
{
useItem.DropItem(); // Ensure the player drops the item before the death animation
}
animator.SetBool("die", true);
dying = true;
}
}
public void HandleDeath() // Removes player from dying state after respawn
{
GameManager.Instance.PlayerDied(this);