+1 vote

whenever i connect a signal in code the debugger alwaays show
The function 'connect()' returns a value, but this value is never used
is there any way to fix it out

in Engine by (940 points)

1 Answer

+1 vote
Best answer

This is a warning. Your code still works. You can configure accordingly.


by (805 points)
selected by

Thank you
But is there any way to fix it

Check for the error. May save you some headache debugging down the line. E.g.

var err=turn_control.connect("turn_changed",self,"turn_changed")
if err:
    print("Error", err)

but if you don't care then do something like this by adding an underscore

var _err=turn_control.connect("turn_changed",self,"turn_changed")

There is a 3rd way but only works one variable at a time:

var err=turn_control.connect("turn_changed",self,"turn_changed")

Thanks a lot

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.