Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Anne | |
Old Version | Published before Godot 3 was released. |
This is in some function:
emit_signal(“variable_changed”, name)
Then, elsewhere, I want to do something like this:
yield(get_node(“.”), “variable_changed(my_variable)”)
I want to yield when that signal is emitted, but only when “my_variable” is passed into the signal. How can I do this?
I can’t imagine what you’re trying to achieve with that kind of program flow. If you want to issue a yield when a signal is fired, that happens inside the function that is connected to the signal. It will only affect the code inside the signal function, but I get the impression you’re wanting to yield elsewhere. Signals are processed at a very specific time so they’re not going to randomly jump inside of any function.
Yield acts a lot like a return statement, but when resume is called it goes back to where it exited and continues execution.
Can you give a description of what you’re trying to do?
avencherus | 2017-02-16 10:05