How do i call a function with parameters using the Node.connect function?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rustyStriker
:warning: Old Version Published before Godot 3 was released.

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

:bust_in_silhouette: Reply From: duke_meister

Is this what you mean?

signal mysignal

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

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.

Mauricio Vera | 2016-07-03 20:29