+1 vote

How can i call a function with parameters(and send the parameters to it) using the Node.connect function?
i just like doing most of the stuff by code
tnx for the helpers

in Engine by (1,193 points)

1 Answer

+2 votes
Best answer

Is this what you mean?

signal mysignal

func _ready():
    connect("mysignal", self, "myfunc", [var1, var2, var3])
    # etc ...

func myfunc(var1, var2, var3):
    if var1 ...
by (715 points)
selected by

Am I missing something? Because I get the error Parser Error: Identifier not found: var1.
I'm trying to emit a signal from an object and making the map receive the signal, but even if I declare a var1 in the map it doesn't get passed to myfunc.

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 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 webmaster@godotengine.org with your username.