- Home /
Change child position to parent with Anchor Point
I am trying to wrap my brain around this. I have a player who can activate a mower. When that happens the mower just becomes a child of the Player. But if the player activates the mower and isn't centered to the mower it lookds funny.
Example:
I have a GameObject on the mower that I am trying to use to line up with the player when you activate it. This would make it easier just moving that anchor point in the inspector. What I am trying to end up with is this:
I tried moving the mowers 'localposition' but I know my calculations are wrong. I would show what I did but their is no need since it is simply wrong.
Answer by Qbasic8 · Jun 14, 2017 at 01:24 PM
Thanks @hexagonius , I did that and it worked out great. I must of had a transform.Position instead of a localPosition.
Please don't answer your own questions. Just comment the solution, it can be converted to an answer, and except it ins$$anonymous$$d
Understood. I will be sure to do that in the future.
Answer by hexagonius · Jun 13, 2017 at 05:18 AM
You could have shown the code, but what you essentially need to do is setting x and z of the localPosition to 0 after folding the mower.