How to change scenes when clicked a button?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jiwooyun_

A noob here

I am currently making a 3D game and I need a playmenu which I have created. In the playmenu, i added a “play” button. The problem is, I don’t know how to make the play button work, meaning when I click it, it will take me to another scene. Any help would help, thanks.

:bust_in_silhouette: Reply From: exuin

You want to connect the button’s “pressed” signal to a function that will change the scene. The docs have some nifty guides for that.

:bust_in_silhouette: Reply From: PEIGNAULT Laurent

Hello,

A simple way, but not the best solution :


As exuin said it’s better to read the guides to found a better solution for memory, speed, data access, depending of your situation.

Have a nice day.

:bust_in_silhouette: Reply From: deaton64

Hi,

if your scenes are getting big, or you want a progress bar as you load, you may want to consider using the ResourceLoader.

I used it because I load scenes mid level and I was seeing the game “jerk” as it loaded. This stopped that for me.

Background loading