Look my code:
When I do this, the "pre_effect" objects do not set the new position using "for each object" in this function.
I tried defining using another function by forcing the "for each object" out of the old function, and it doesn't work.
Develop games in your browser. Powerful, performant & highly capable.
You need to allow one tick of execution for newly created objects to actually be created and so that a loop/sub-event could pick and apply/get values to/from those instances (such as their X/Y).
In your case, I'd suggest, in event 174 to set global variables to the value of X/Y you are creating your object's instance at. You could then create your pre_effect instance using those global variable values.
Then, in event 175, instead of referring to the newly created pre_effect.x, you would refer to the global variable as well.
Oh, thank you for your answer, but i prefer to create a new array, who work with this numbers, i prefer use that:
Well, in this new excerpt your array creates elements to the same position, seeing it is based on global variables which value do not change, since it is out of the loop that makes their value change.
I put the "for each array x element" in the same layer of "direcao" variable comparison and it work.
Thank you again for your answer.