Hi,
I hope I'm not asking something ridiculous (for once).
I am using globalToLocal to preserve the position of a sprite (mySprite) when I add it to a new parent (myParent).
This works as expected.
However, the scale of myParent is applied to mySprite. I would like to keep mySprite at the exact coordinates, scale, everything as it was before changing its parent.
I found some ways to get the expected result, but I would like to know if there is a built-in way to achieve it?
Something more efficient and straightforward, to complete the goal of the globalToLocal function.
thanks
(and now
@ar2rsawseen is going to tell me that the solution was right under my nose.
I'm getting prepared.
Comments
The problem is, that even if parent is scaled, the child would still report scale 1
So the only solution seems to be to copy the transformations from needed parent to its child. If you want to copy all transformation, you can probably use matrices, if not, you would need to copy them one by one
Got it, thank you.