From 6a14b5be4feaadb470c4a7b4ed7dca8aa9961aa7 Mon Sep 17 00:00:00 2001 From: br0kenpixel Date: Tue, 5 May 2026 11:08:07 +0200 Subject: [PATCH] prevent dead zombie from sliding on floor --- Assets/Scripts/ZombieController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/ZombieController.cs b/Assets/Scripts/ZombieController.cs index db6aab1..001cb2b 100644 --- a/Assets/Scripts/ZombieController.cs +++ b/Assets/Scripts/ZombieController.cs @@ -1,6 +1,7 @@ using UnityEngine; - [RequireComponent(typeof(Animator))] + +[RequireComponent(typeof(Rigidbody))] public class ZombieController : MonoBehaviour { private static readonly int DieHash = Animator.StringToHash("Die"); @@ -41,6 +42,7 @@ public class ZombieController : MonoBehaviour private void Update() { if (player == null) return; + if (currentHealth == 0) return; float distance = Vector3.Distance(transform.position, player.position);