Godot Version
4.3
Question
I have an autoload like this:
extends Node
var world_scene: PackedScene = load("res://scenes/world.tscn")
var levels
var main: Main
Here is my main.gd
extends Node3D
class_name Main
var main_menu: PackedScene = load("res://scenes/ui/main_menu.tscn")
var world: World
func _ready() -> void:
Game.main = self
And finally world.gd (part):
func _ready() -> void:
Game.main.world = self
I have a menu with “reset” button like this:
func _on_button_pressed() -> void:
Game.main.world.reset_level()
While it is working fine inside Godot editor, when I export it to the exe, nothing happens on click. And there is many more errors relating to accessing variables via Game.main.world
. Any ideas what is going on? Why it works in Godot but not in exe?