mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-21 23:54:23 +00:00
Spawner
: spawn things on self if no MainGame is found
This commit is contained in:
parent
ba8dd72ed5
commit
9739a089d5
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue