From 0c2cefb2554d9858c32aa0931847d0d3ee24ef69 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 15 Apr 2024 21:51:24 +0200 Subject: [PATCH] Fix spawner sometimes failing to spawn --- behaviours/spawner.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/behaviours/spawner.gd b/behaviours/spawner.gd index 507117a..b1c9d6e 100644 --- a/behaviours/spawner.gd +++ b/behaviours/spawner.gd @@ -11,7 +11,7 @@ func spawn(): entity.global_scale = global_scale entity.global_position = global_position entity.global_rotation = global_rotation - parent.add_child(entity) + parent.add_child.call_deferred(entity) # Not sure why this is needed. func _ready(): if parent == null: