Skip to content

Commit

Permalink
Fix Enemy jitter near home position
Browse files Browse the repository at this point in the history
  • Loading branch information
outfrost committed Apr 26, 2021
1 parent 34deed7 commit 0201394
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions character/Enemy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func _physics_process(delta:float):

else:
var towardshome = ((home - self.position).normalized() * self.run_speed)
move_and_slide(towardshome)
if (home - self.position).length_squared() > 4.0:
if (home - self.position).length_squared() > 8.0:
move_and_slide(towardshome)
try_play_walk_sound()
else:
walk_sound_timer = 0.0
Expand Down

0 comments on commit 0201394

Please sign in to comment.