When I want to change a parent’s position without changing the world positions of the children, I temporarily reparent the children before changing the parent’s position and then I parent them again. This can get tedious if I need to do this many times. Is there a tool or a built-in feature that can help?
Makes me question why you need the children parented if they shouldn’t move with their parent? Respectively, why it matters where the parent is if the children should stay at their world pos?
Sounds like these children shouldn’t be parented, or not to that particular parent. It’s not a commonly noticed issue for the above reasons.
Nevertheless, you could make an editor script yourself but it’s probably best to rethink your approach here. For instance, rather than parent/children
you could have the parent be a sibling of the current children, ie parent/used to be parent
and then parent/former children/child1 2 3..
I do want them to move with the parent. I just need to lock the children during a one-time adjustment in the editor and then have them unlocked afterwards.
To explain, it’s a tile-based game with rooms and sub-rooms for organizational purposes. It’s best when everything is aligned with the grid. Sometimes a room’s children are aligned with the grid correctly in terms of their world positions but the parent’s position is off which means the local positions of all the children are off too. So maybe the room’s position is 5.87 and then the children’s positions are things like 1.13, 2.13, and 3.13. It would be better if the parent was at 6 and then the children were at 1, 2, and 3.
I’ve had to do this in the past on some projects. There’s isn’t an OFFICIAL way, but typically I’ll do the following:
- Unparent Children
- Move Parent where you want to place it
- Reparent Children by dragging them back in from hierarchy
That should solve your problem.
I’m sure you could write a small editor tool that would do this for you automatically. I’d do it like this:
You can modify the transform to basically have an additional bit of metadata (Worldspace Position), then constantly set it back whenever you move the parent objects. It’s a bit janky, but shouldn’t be too hard to “lock” the transform in place globally with a little tool like this.