scene changers should be clearing all spawned objects on scene exit

This commit is contained in:
derek
2025-04-03 16:59:46 -05:00
parent 0c76ba47f7
commit 32b9efbd92
3 changed files with 6 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ var rot_amount : float
func _ready():
SignalBus.enemy_killed.connect(enemy_in_room_killed)
SignalBus.game_loaded.connect(assign_elements)
assign_elements()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):

View File

@@ -27,6 +27,10 @@ func _on_body_entered(body: Node3D) -> void:
for i in spawned_stuff:
i.queue_free()
func clear_spawned_objects():
for i in get_tree().current_scene:
if i.is_in_group("spawned"):
i.queue_free()
func _on_start_activation_timeout() -> void:
active = true