Hi! New here. How do i reset my positions of multilple Objects vs Instances?

Hi! I’m new here and new to game dev in general.

I’m strugling to understand how to “reset” the position of 3 Objects\Instances at once… The situation:

I am creating a simple soccer game, where the user can play with 3 players (circles) - the user clicks with the mouse and the circle moves and ‘kicks’ the ball.
I want to make it so that when there is a goal the three players return to their starting points.
The problem is that I don’t know how to approach it - if I tell the whole object (the 3 players) - they all return to the same point X Y (on top of each other).
How can I make sure everyone gets back to their point?

I can make an X,Y position variables for each instance of the players but i cannot access and use them in the events… So i should do a separate Object for each player?
Thanks!!

Check out this post, and see if it helps.

Use it in conjunction with a for each object event.

1 Like

I usually make object variables initX and initY and set them on start of the scene for each object to object’s X and Y coordinate respectively (so I save their position in memory basically). Then when I need to “reset” them, I just move them to their initX, initY position.

1 Like