0 votes

How do I make a for loop that yields a function until all the objects of an array emit a signal.
for example:

func example():
   #start of code
   for i in array:
       #yield code until every i emits a signal
    #resume code

What I have is:

func example():
   #start of code
   for i in array:
       yield(i,"signal")
    #resume code

But this only yields the code when the signal is emitted

in Engine by (18 points)

1 Answer

0 votes

You need to explain this some more :)

your example function should hold whole loop until all nodes emit signals in correct sequence. It is not what You wanted ? What are these nodes supposed to be and in what pattern do they emit their signals ? Is it like gamephases commencing, when next player waits for his move in turn based game ? Or some call to return to formation when everyone finishes attack ?

by (5,252 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.