0 votes

I am currently trying out the timer node to call a function, but at first glance it seems to be unable to activate a function that has an argument because I have to call the function by its name only.

func ready()
     timer = Timer.new()
     timer.connect("timeout", self, "activate")

func activate(arg)

How can I use connect() in a way that lets me send an argument (a String in this case) to the function it calls?

in Engine by (12 points)

1 Answer

+2 votes
timer.connect("timeout", self, "activate", ["arg_value1", "arg_value2"])
by (9,768 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 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.