This uses two functions in SceneTree to switch between two scenes.
Language: GDScript
Renderer: Mobile
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/531