Now About Social Code
summaryrefslogtreecommitdiff
path: root/scripts/enemy.gd
diff options
context:
space:
mode:
authorLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-09-22 19:57:04 +0100
committerLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-09-22 19:57:04 +0100
commit84bb8cbec9dd17fd86885f378208ebfec96a3f77 (patch)
treef9a1660ad23d4f674e271e5f825af3dbf8168151 /scripts/enemy.gd
parent599c8dd969ca3eec1767eaf3585ae9a32d23fa57 (diff)
bsp_level_generator: Fix navmesh generation
Make it so doors generate properly in the navigation mesh
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: