Godot Version
v4.6.1
Question
I’m working on a 2D game, and when using the Godot “Run Project” button in the Editor, the window it opens works as intended, I can play my game. But when I compile it to anything, Windows, Linux, Android, doesn’t matter, I can’t click anything on my titlescreen. The hover effects for the buttons work just fine, but nothing happens on click. Running it on Windows with the console executable, I do get the following output:
Godot Engine v4.6.1.stable.official.14d19694e - https://godotengine.orgOpenGL API 3.3.0 - Build 31.0.101.4575 - Compatibility - Using Device: Intel - Intel(R) UHD Graphics 770
ERROR: Attempt to open script ‘res://addons/discord-rpc-gd/nodes/discord_autoload.gd’ resulted in error ‘File not found’.at: (modules/gdscript/gdscript.cpp:1127)ERROR: Failed loading resource: res://addons/discord-rpc-gd/nodes/discord_autoload.gd.at: (core/io/resource_loader.cpp:343)ERROR: Failed to instantiate an autoload, can’t load from path: res://addons/discord-rpc-gd/nodes/discord_autoload.gd.at: (main/main.cpp:4401)SCRIPT ERROR: Parse Error: Identifier “DiscordRPC” not declared in the current scope.at: GDScript::reload (res://scripts/startScreen.gd:5)SCRIPT ERROR: Parse Error: Identifier “DiscordRPC” not declared in the current scope.at: GDScript::reload (res://scripts/startScreen.gd:7)SCRIPT ERROR: Parse Error: Identifier “DiscordRPC” not declared in the current scope.at: GDScript::reload (res://scripts/startScreen.gd:9)SCRIPT ERROR: Parse Error: Identifier “DiscordRPC” not declared in the current scope.at: GDScript::reload (res://scripts/startScreen.gd:11)SCRIPT ERROR: Parse Error: Identifier “DiscordRPC” not declared in the current scope.at: GDScript::reload (res://scripts/startScreen.gd:13)SCRIPT ERROR: Parse Error: Identifier “DiscordRPC” not declared in the current scope.at: GDScript::reload (res://scripts/startScreen.gd:15)SCRIPT ERROR: Parse Error: Identifier “DiscordRPC” not declared in the current scope.at: GDScript::reload (res://scripts/startScreen.gd:17)SCRIPT ERROR: Parse Error: Identifier “DiscordRPC” not declared in the current scope.at: GDScript::reload (res://scripts/startScreen.gd:19)ERROR: Failed to load script “res://scripts/startScreen.gd” with error “Parse error”.at: load (modules/gdscript/gdscript.cpp:2907)
I also removed the DiscordRPC code from the titlescreen, and it does let me use the buttons, but then loading the gameplay scene by clicking start gives me this:
Godot Engine v4.6.1.stable.official.14d19694e - https://godotengine.org
OpenGL API 3.3.0 - Build 31.0.101.4575 - Compatibility - Using Device: Intel - Intel(R) UHD Graphics 770
ERROR: Attempt to open script 'res://addons/discord-rpc-gd/nodes/discord_autoload.gd' resulted in error 'File not found'.
at: (modules/gdscript/gdscript.cpp:1127)
ERROR: Failed loading resource: res://addons/discord-rpc-gd/nodes/discord_autoload.gd.
at: (core/io/resource_loader.cpp:343)
ERROR: Failed to instantiate an autoload, can't load from path: res://addons/discord-rpc-gd/nodes/discord_autoload.gd.
at: (main/main.cpp:4401)
SCRIPT ERROR: Parse Error: Identifier "DiscordRPC" not declared in the current scope.
at: GDScript::reload (res://scripts/gameplayController.gd:15)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
SCRIPT ERROR: Parse Error: Identifier "DiscordRPC" not declared in the current scope.
at: GDScript::reload (res://scripts/gameplayController.gd:17)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
SCRIPT ERROR: Parse Error: Identifier "DiscordRPC" not declared in the current scope.
at: GDScript::reload (res://scripts/gameplayController.gd:19)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
SCRIPT ERROR: Parse Error: Identifier "DiscordRPC" not declared in the current scope.
at: GDScript::reload (res://scripts/gameplayController.gd:21)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
SCRIPT ERROR: Parse Error: Identifier "DiscordRPC" not declared in the current scope.
at: GDScript::reload (res://scripts/gameplayController.gd:23)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
SCRIPT ERROR: Parse Error: Identifier "DiscordRPC" not declared in the current scope.
at: GDScript::reload (res://scripts/gameplayController.gd:25)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
SCRIPT ERROR: Parse Error: Identifier "DiscordRPC" not declared in the current scope.
at: GDScript::reload (res://scripts/gameplayController.gd:27)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
SCRIPT ERROR: Parse Error: Identifier "DiscordRPC" not declared in the current scope.
at: GDScript::reload (res://scripts/gameplayController.gd:29)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
ERROR: Failed to load script "res://scripts/gameplayController.gd" with error "Parse error".
at: load (modules/gdscript/gdscript.cpp:2907)
GDScript backtrace (most recent call first):
[0] _on_start_pressed (res://scripts/startScreen.gd:10)
How do I keep DiscordRPC in the main start screen and still be able to update it in other scenes without it erroring like this?