Reputation: 499
This is a screenshot of the objects the Platform and the Button when they are not child of the Elevator. And this is how each object transform should be.
Then i move drag the objects to be child of the Elevator:
I didn't change anything in the objects transform not rotation and position not scale. I just want to put them under the elevator.
The elevator is the big cube.
The terrain Transform: Position and Rotation 0 0 0 Scale 1 1 1
The elevator position: x = 263.05 y = 0.1 z = 148.32
rotation: x = -2.065 y = 19.039 z = -89.252
scale x = 0.1 y = 5 z = 2
The button when child: x = -4.0700 y = 0.72499 z = -0.5510
x = -36.49 y = 2.436 z = 96.1960
x = 0.22 y = 10.13 z = 0.19
When the button is not child: x = 266.106 y = 0.514 z = 146.082
x = -0.082 y = 55 z = 6.9
x = 0.8 y = 1.6 z = 0.5
Upvotes: 0
Views: 269
Reputation: 2576
That's because game objects transforms form a scene graph and so the final position of a game object is given by the accumulation of all transforms from the root to the game object.
Thus, When you moved the capsule and the cube to the "elevator" sub-tree, you indirectly set the non-uniform scale that was set in the "elevator" sub-tree root through the transform accumulation process explained above.
EDIT:
To quickly solve your problem create a new game object and set it as the parent of all other objects (elevator, button and platform). I suppose you want to have some animation that animates all objects at the same time. That will do the trick.
Upvotes: 1