UI elements don't function (but load) when i change scenes or the scene reloads

Godot 4.2.2

Basically, when my games scene changes like from the main menu to the actual game project, the UI’s elements will stop working, it won’t update, the functions are treated as null, but the elements’s textures will load weirdly. But everything else doesn’t work, the buttons etc. And when the the UI’s function is called, it’ll error because it doesn’t exist. This also happens when the scene reloads (eg when the player dies). No clue what caused this.

Error when function called: “Invalid call. Nonexistent function ‘create_question_ui’ in base ‘CanvasLayer’.”
Other related errors: “E 0:00:01:0874 main_menu.gd:6 @ _on_play_button_pressed(): Another resource is loaded from path ‘res://Scenes/ui.tscn’ (possible cyclic resource inclusion).”,

I think it is about recursion since your are preloading the scene in itself. So loading your scene from a file path and not a packedScene might fix this issue?

1 Like

i solved it! not exactly what you said but basically in one script of a scene i was preloading the UI as a packedscene but even tho i never even used it in my code ever it caused a ton of issues i guess. but thanks :smiley:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.