0 votes

Ive tried
func onVideoPlayerfinished():
get
tree().change_scene("res://path/to/World.tscn")

and still, nothing happens. can someone help me???

Godot version 3.3.2 stable
in Engine by (14 points)

1 Answer

0 votes

It's tough to tell from the code you posted (it's always good practice to format your code using the "Code Sample" brackets, to make sure it is fully legible), but it looks like you have gettree() instead of get_tree(), which could be the problem.

If that's not the problem, double check that the path to the scene you want to start is correct. Looks like res://path/to/World.tscn could be code copied from an online tutorial, which won't work for you unless your "World.tscn" scene is inside a folder called "to" which is inside a folder called "path". If "World.tscn" is in the root folder of your project, with no subfolder, the path would be "res://World.tscn."

But you can easily find out exactly what the path is for your World.tscn scene by going to the FileSystem dock (which defaults to lower left of the Godot interface), right clicking that particular scene, clicking on "Copy Path," and then pasting that path into the quotation marks - which should look something like this:

get_tree().change_scene("res://World.tscn")

You can also use print() to debug the code, find out where the issue is - adding this line to the function right below get_tree...

print ("You should have changed scenes by now!")

... and then checking the console to see whether that text comes up. If it doesn't show up in the console, it means there's a problem with the function itself - maybe a signal isn't properly connected.

by (172 points)

omg, thanks soo much it worked!

That's great! If you wanted to click the check mark to "select this as best answer," that'd be awesome.

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.