- Home /
How do I rotate my parent object without rotating the child object?
This is driving me a bit bonkers.
I have a parent gameobject, let's call it Parent. All it has is an animator with one animation. The animation rotates its Y from 0 to 180.
The Parent has a child (appropriately named Child). The child's local position, the position displayed in the inspector, is (0,0,0) and it's local rotation is (0,0,0).
When the Parent animation plays, and it rotates itself from 0 to 180, I would expect the Child object to stay at 0,0,0 rotation, because as a child, it's relative to the parent. However, for some reason, the child's rotation also is moving to 180, which is not the desired behavior. I want the parent to rotate to 180 (which it is) and the child to stay at 0,0,0.
What am I missing here? I've ensured the animation is only animating the parent's Y property, literally nothing else. Not sure what else to do.
All help is appreciated. Thanks!
Does the child show rotation in the inspector? Its local rotation should stay at 0 but its global rotation will match the parent as it's position and rotation are relative to it.
Answer by jimau · Aug 08, 2020 at 01:29 AM
If you want a child object to be unaffected by transformations to it's immediate parent, the typical solution is reparent both objects to a new null object