+2 votes

I want to use a signal with arguments in godot v3.1.1 .

Something like this:

signal my_signal(arg: int)
in Engine by (39 points)
edited by

2 Answers

+4 votes
Best answer

It's not possible, yet. Although, it may be added in 3.2.

See this issue on GitHub.

by (4,081 points)
selected by
+1 vote
extends Node

signal my_signal

var number: int = 10
var stringy: String = "Yo"


func _ready():
    connect("my_signal", self, "_testing")
    emit_signal("my_signal", number, stringy)


func _testing (num: int, texty: String): # <--- Here, in the custom method
    print(str(num) + " " + texty)
by (60 points)
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.