Make slugs renavigate every second
This commit is contained in:
parent
412a151d45
commit
4f85a9bfcc
|
@ -126,3 +126,8 @@ func _on_NavigationAgent2D_target_reached() -> void:
|
|||
print("reached distsq = ", dsq)
|
||||
if dsq < 256:
|
||||
self._at_target()
|
||||
|
||||
|
||||
func _on_RenavigateTimer_timeout() -> void:
|
||||
if target != null:
|
||||
_agent.set_target_location(target.global_position)
|
||||
|
|
|
@ -50,4 +50,8 @@ path_max_distance = 64.0
|
|||
[node name="SlimyWalkSfx" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 8 )
|
||||
|
||||
[node name="RenavigateTimer" type="Timer" parent="."]
|
||||
autostart = true
|
||||
|
||||
[connection signal="target_reached" from="NavigationAgent2D" to="." method="_on_NavigationAgent2D_target_reached"]
|
||||
[connection signal="timeout" from="RenavigateTimer" to="." method="_on_RenavigateTimer_timeout"]
|
||||
|
|
Loading…
Reference in New Issue