mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2024-11-10 00:52:10 +01:00
Stop agents from processing if the scene tree is paused (#57)
This commit is contained in:
parent
22dc7c751a
commit
f615a183ea
@ -50,7 +50,7 @@ func _apply_sliding_steering(accel: Vector3, delta: float) -> void:
|
||||
if not _body:
|
||||
return
|
||||
|
||||
if not _body.is_inside_tree():
|
||||
if not _body.is_inside_tree() or _body.get_tree().paused:
|
||||
return
|
||||
|
||||
var velocity := GSAIUtils.to_vector2(linear_velocity + accel * delta).clamped(linear_speed_max)
|
||||
|
@ -132,7 +132,7 @@ func _on_SceneTree_physics_frame() -> void:
|
||||
if not _body:
|
||||
return
|
||||
|
||||
if not _body.is_inside_tree():
|
||||
if not _body.is_inside_tree() or _body.get_tree().paused:
|
||||
return
|
||||
|
||||
var current_position := _body.transform.origin
|
||||
|
@ -51,7 +51,7 @@ func _on_SceneTree_frame() -> void:
|
||||
if not _body:
|
||||
return
|
||||
|
||||
if not _body.is_inside_tree():
|
||||
if not _body.is_inside_tree() or _body.get_tree().paused:
|
||||
return
|
||||
|
||||
var current_position := _body.global_position
|
||||
|
@ -50,7 +50,7 @@ func _on_SceneTree_frame() -> void:
|
||||
if not _body:
|
||||
return
|
||||
|
||||
if not _body.is_inside_tree():
|
||||
if not _body.is_inside_tree() or _body.get_tree().paused:
|
||||
return
|
||||
|
||||
var current_position := _body.transform.origin
|
||||
|
Loading…
Reference in New Issue
Block a user