scene changers should be clearing all spawned objects on scene exit
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user