0 votes

Hi, im really new to gdscript and I'm trying to make a game for a school project and i cant figure out how to change the scene.tscn based upon what scene i am already in.

Currently I've just been using a timer when my player dies that changes back to the title screen.

func onTimertimeout():

but i want to change it to something like this:

func onTimertimeout():
IF current
scene = ("SceneOne.tscn")


in Engine by (21 points)

We can get the current scene path using gettree().currentscene.filename
Now extracted to filename from the path.

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.