You've already forked zumbi-game
prevent dead zombie from sliding on floor
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user