Now About Social Code
summaryrefslogtreecommitdiff
path: root/scripts/enemy.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/enemy.gd')
-rw-r--r--scripts/enemy.gd5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/enemy.gd b/scripts/enemy.gd
index 1c4c063..716493c 100644
--- a/scripts/enemy.gd
+++ b/scripts/enemy.gd
@@ -67,10 +67,13 @@ func chase_nav_mesh(delta: float):
# We only want to navigate on XZ plane
new_velocity.y = 0
- velocity = new_velocity
+ velocity = velocity.move_toward(new_velocity, .25)
if not is_on_floor() and gravity_enabled:
velocity.y -= gravity * delta
+ else:
+ velocity.y = 0
+
move_and_slide()
func _physics_process(delta: float) -> void: