0 votes

I have 5 different Level scenes and in my TitleScreen scene there is a button for every level. Pressing it changes to the BaseGame scene. Now I want to instance the right level scene to the BaseGame scene. How?

asked Jun 26 in Engine by MaaaxiKing (291 points)

Question title is very wrong.

2 Answers

0 votes

instance(), as with any situation where you need to instance something

answered Jun 27 by selamba (136 points)
0 votes
var instancedScene = load("res://levelScene.tscn")
var level = instancedScene.instance()
add_child(level)
  1. Create a variable to load the scene you want.
  2. Turn it into an instance
  3. Append it
answered Jun 27 by jasonwolf493 (18 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.