I want to make a rotatable map. I tried to use Pin Object To Another example, but the child object position is changed when it’s running. Here is the position on the editor
but when I run it, the result is:
Is it possible to make the position of child does not change when it’s running?
Can you provide a screenshot of the events?
I didn’t change the default events. I just move and resize the object on the editor. Here is the event sheet:
I think the problem will be that the origin is at the centre of the original object, at specific co-ordinates. When you resize, the isn’t at the centre any longer. And the “Put child around parent” uses the centre of the object, whereas the angle calculation uses the origin.
In the event action that sets the AngleToParent, use child.X(“Center”), child.Y(“Center”), parent.X(“Center”) and, parent.Y(“Center”). This should solve your issue.
I will try it now. Thank you so much.
Ah, my bad. Undo those “Center” positions. Can you check that the origin is at the centre of the sprite (click on edit points when you double click the object in the editor)?
Maybe, you can make points and change the position of obj2 to parent.point. And then maybe you can do: change the angle of obj2 to parent.angle.
Solved. Thank you so much!