From 84bb8cbec9dd17fd86885f378208ebfec96a3f77 Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Sun, 22 Sep 2024 19:57:04 +0100 Subject: bsp_level_generator: Fix navmesh generation Make it so doors generate properly in the navigation mesh --- scripts/enemy.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/enemy.gd') 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: -- cgit