get_tree().change_scene_to_file decides not to work
-
Heya! I've been working on a somewhat small project for a gamejam, and I've noticed that for seemingly no reason whatsoever, sometimes (rarely) works, and most of the time it doesn't. I have it set up so when you press the button, it goes to the testing scene, but it seems so sporadic that it's out of my control. Here's the github for my project so y'all can figure out what I did wrong, and the main menu script for those of you who want a quick look at it : https://github.com/Punkgrin/A-Momentous-Occasion ```
extends CanvasLayer
func _ready(): Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE);
func _on_play_pressed():
get_tree().change_scene_to_file("res://Scenes/main.tscn")func _on_testing_pressed():
get_tree().change_scene_to_file("res://Scenes/testing.tscn")func _on_options_pressed():
pass # Replace with function body.func _on_quit_to_desktop_pressed():
get_tree().quit() -
Quick update: I've also run into a strange bug where after I do an oddly specific change (moving the stuff in the _process() function of testing.gd to the player script), finding nodes no longer works via ANY method (i.e. string reference through get_child(), get_parent() or get_node(), scene reference through PackedScene, etc). I know that it's possible to replicate via some method, because I've done it twice, but I have no idea what specifically is causing it.
-
-
Yet another update; I changed literally nothing about the project, then came back 5 days later and everything works. I would love if someone could investigate this though, as I think it could benefit the Godot community heavily.
-
-
I have officially found the issue, and it seems to be that as soon as I enable autoload on literally anything, that's when the node system stops working, so for those of you who are seeing the same issue, I would avoid autoload because it seems to be VERY buggy.
4/4