Set a variable to a parameter

how to set a variable to a parameter


tried doing this but it thinks that’s the variable name

Just like with normal events, you cannot dynamically select a top level variable via expressions in an extension, it doesn’t have anything to do with parameters.

You would need to make it a child of a structure variable, and do something like MyParentVariableName[ToString(GetArgumentAsString(“wait_identifier”)].

1 Like

tried
didn’t work either

No one can help you until you showed what you tried. You’ll also need to show the variables you created.

  1. Did you just copy/paste what I posted above? Because that’s not going to work. You need to understand the context of what was posted above and build out your own expression. I’m inclined to believe you just copy/pasted since you’re missing the same closing parenthesis I am.
  2. Do you actually have a wait_identifier argument created? It won’t work without it either.

1- yes uhh I thought I just needed to copy it, is there any tutorials about this?
2-yes
Capture

Sure, access http://wiki.compilgames.net/doku.php/gdevelop5/all-features/variables#scopes and scroll up to the accessing variables dynamically.

thanks a lot :slight_smile:
(typing more for the minimum 20 characters)