I have got a loop event, to create buttons (objects) dynamically. To create the buttons, I'm trying to use a function. The loop event is creating the buttons, but not updating the instance variables right below calling the function. How can I take care of this situation?
The loop -
The function -
Please help.
Thank you
Develop games in your browser. Powerful, performant & highly capable.
Instance variables should be set inside the function where the correct instance is picked
The item won't be picked on return from the function. You could pass back the UID of the new object and pick it before proceeding, or, as lionz suggests, pass in the other values to the function.
Thank you both :)