This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I am currently creating an inventory with 3 columns. In the middle one I have a button which shall make a scroll container appear above the other stuff in the inventory. I am not entirely sure how to go about this, so I first tried to create a new scene with the scroll container and make it appear on button pressed. Well this works, BUT the rest of the inventory disappears as I change the scene... This does not look quiet all right. Is there another way to do this?

This is how I change scenes:

func goto_scene(path):
call_deferred("_deferred_goto_scene", path)

func deferredgotoscene(path):
current
scene.free()
var s = ResourceLoader.load(path)
currentscene = s.instance()
get
tree().getroot().addchild(currentscene)
get
tree().setcurrentscene(current_scene)

Maybe I should not use the current_scene.free(), but in general I am not sure if changing scenes is a good way to tackle this.

in Engine by (57 points)

Apparently, ommitting the current_scene.free() makes everything look alright, but I am still not sure if changing the scene is really neccessary and a good solution.

Please log in or register to answer this question.

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.