0 votes

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 physicsprocess(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.

Godot version Godot_v3.3.2
in Engine by (12 points)

1 Answer

0 votes

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

by (4,644 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.
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 webmaster@godotengine.org with your username.