Diffstat (limited to 'utils.gd')
| -rw-r--r-- | utils.gd | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils.gd b/utils.gd new file mode 100644 index 0000000..9140d1a --- /dev/null +++ b/utils.gd @@ -0,0 +1,8 @@ +extends Node + +func instance_scene_on_main(scene, position): + var main = get_tree().current_scene + var instance = scene.instance() + main.add_child(instance) + instance.global_position = position + return instance |