1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 15:44:23 +00:00

Spawner: spawn things on self if no MainGame is found

This commit is contained in:
Steffo 2024-04-19 03:48:25 +02:00
parent ba8dd72ed5
commit 9739a089d5
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

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