#spawn scene
1 messages · Page 1 of 1 (latest)
first thing you have to do is set a variable to the scene you want to load.
You can preset it in the code with
var scene = preload("scenelocation")
or edit it using:
@export var scene: PackedScene
and drag the scene into the variable on the inspector.
once your ready to spawn it in code:
var newScene = scene.instantiate()
spawnLocationNode.add_child(newScene)
var YourScene = preload("res://Scenes/Your Scene.tscn")
var newScene = YourScene.instantiate()
add_child(newScene)
Thanks y'all
Your welcome 😄