This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

How to get variables from signal passed to yield ?

Hi everyone. Task seems to be simple enough but I can't find solution. I'm yielding to signal, this signal carry important information as variable in arguments. How I can get argument variable from yielding signal ?
Thanks
-Garrom


Tags :

Best Answer

  • ZenzorZenzor Posts: 6
    edited September 2018 Accepted Answer

    In some function
    emit_signal("variablechanged", name)

    while yield(self, "variablechanged") != "my_variable": pass

Answers

  • ZenzorZenzor Posts: 6Member
    edited September 2018 Accepted Answer

    In some function
    emit_signal("variablechanged", name)

    while yield(self, "variablechanged") != "my_variable": pass

  • GarromOrcShamanGarromOrcShaman Posts: 214Member

    @Zenzor said:
    In some function
    emit_signal("variablechanged", name)

    while yield(self, "variablechanged") != "my_variable": pass

    So, if there is no argument variables, GDcriptFunctionState is returned, otherwise, variable is returned ? I was sure I'm going to get GDScriptFunctionState instanse. So confusing, mainly because there is nothing in docs about it. Docs says that I get GDcriptFunctionState because it is return type of yield. Thanks for help

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.