Stop agents from processing if the scene tree is paused (#57)

This commit is contained in:
Josh Anthony 2021-12-14 11:34:27 -06:00 committed by GitHub
parent 22dc7c751a
commit f615a183ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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