From 9739a089d53572c072a6d4ee68536d01126554d1 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 19 Apr 2024 03:48:25 +0200 Subject: [PATCH] `Spawner`: spawn things on self if no MainGame is found --- behaviours/spawner.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/behaviours/spawner.gd b/behaviours/spawner.gd index d4680d0..2bbbee5 100644 --- a/behaviours/spawner.gd +++ b/behaviours/spawner.gd @@ -11,6 +11,8 @@ signal spawned(entity: Node2D) func spawn(): if not target: target = MainGame.get_ancestor(self).default_spawn_parent + if not target: + target = self var entity = scene.instantiate() entity.global_scale = global_scale entity.global_position = global_position