system
1
|
|
|
 |
Attention |
Topic was automatically imported from the old Question2Answer platform. |
 |
Asked By |
thinkingfield |
Very simple program using
func _ready():
get_node(“…/Button”).connect(“pressed”, self, “_Button_Pressed”)
gives me the above error. It’s not fatal but it is annoying if you have OCD 
Anyway to get rid of this besides giving it a dummy variable that will not be used and will probable cause another similar error?
Thanks
system
2
|
|
|
 |
Reply From: |
njamster |
connect
is returning an Error-enum, so the proper way would be:
var error = get_node("../Button").connect("pressed", self, "ButtonPressed")
if error:
print("Connect failed")
You can disable certain warnings under Project Settings > Debug > Gdscript, though I wouldn’t recommend that. These warnings exist for a reason.
Perfect thanks!
thinkingfield | 2020-02-09 16:55