Using scaled and rotated object as parent

I’m seeing some confusing behaviour in the Unity scene editor.

New blank project
GameObject - Create Other - Cube
Scale it a bit
Rotate it a bit
Rename it Cube1
GameObject - Create Other - Cube
Move it away from Cube1
Rename it Cube2

Drag Cube1 onto Cube2 in the Hierarchy window - Cube1 becomes a child of Cube2. Both cubes look like they did before, as expected.
Undo.
Drag Cube2 onto Cube1 in the Hierarchy window - Cube2 becomes a child of Cube1. Unexpectedly, Cube2 has changed appearance: it now looks scaled and rotated.

This only seems to happen if Cube1 was both scaled and rotated.

What’s going on?

“scale can not be represented correctly in a 3 component vector but only a 3x3 matrix”

Hi,

Generally, in 3D applications, an object’s transform is calculated in Parent space.

Think of it like this- If the entire Universe was to instantly stretch and double it’s width, we would notice no difference as every point of reference would be stretched too.
In your example, Cube2 still thinks that it hasn’t been scaled/rotated, because relative to its parent, it hasn’t.

The Scale and Orientation of World space never changes, so that’s always the point of reference to us in the viewport.
So it’s like we’re observing Cube2’s stretched universe from outside :slight_smile:

Hope that helps!

This analogy is misleading: it doesn’t capture the difference between Cube1 being scaled + rotated, or being scaled only. Also, it doesn’t account for the fact that information is permanently lost by the parenting: if Cube2 is un-parented, its scale will be different.