Fixed chase states

This commit is contained in:
2026-02-11 23:56:31 +03:00
parent 2562366d8a
commit 1f25c93fc1
17 changed files with 81 additions and 184 deletions
@@ -1,3 +1,4 @@
@abstract
class_name CultistChaseState
extends CultistMoveState
@@ -13,7 +14,11 @@ func physics_process(delta: float) -> void:
if player != null:
cultist.target_x = player.position.x
if is_equal_approx(cultist.position.x, cultist.target_x):
if _is_target_reached() or _wall_ray_cast.is_colliding():
switch_state.emit(look_around_state)
else:
cultist.update_x_velocity(_direction, cultist.MAX_CHASE_SPEED, delta)
@abstract
func _is_target_reached() -> bool