I’m trying to align an instance of a game piece to a location on the board. A the moment a player selects their game piece instance (i.e. white circle) and drags it to a location on the board for that specific place (black circle). I am trying to align this single instance of a white circle to the single instance of the black circle.
What is the expected result
Align the white circle to the closest black circle. Next move a new white circle gets aligned to another black circle
What is the actual result
Misaligned or all objects Center on a single black circle
Hi! Are your black circles objects or are they part of the background? If both are objects, the black circles and the white circles, you could use their center points to position them.
Can you provide a screen snip of the events that deal with dropping the player piece and positioning it over the black circles?
And also a screen snip of the points for both the player piece and the black circles? If the black circles are part of a background image, then making them a separate object would make things a lot simpler.
One improvement I’d suggest - since player1 is dragged around, use a standard event with Player1 was just dropped and the "Pick the circle2 nearest..." as conditions instead of repeating for each player1.
With the "Repeat for each object" event, the condition and actions are performed every game frame. This isn’t necessary, as the actions only need to be run when the dragging action has finished.