How do I keep my menu screen up when I'm using this to change scenes?

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

I’m using a main control to change scenes in a visual novel and I can’t get to the main menu without cutting out my change scene func:

var sceneCall = 1
var sceneComplete = 0
var sceneInProgress = 0

func _physics_process(delta):

if not sceneInProgress:
	get_tree().change_scene("res://Scenes/scene" + str(sceneCall) + ".tscn")
	sceneCall += 1
	sceneInProgress = 1

The main control script is set as a singleton. I can’t figure out how to stay on the menu screen when starting the game.

:bust_in_silhouette: Reply From: Wakatta

Set sceneinProgress to 1 since physics_process gets called every frame

var sceneInProgress = 1

Then from your menu screen when play/continue is pressed set it to 0