[U3] Parenting and unparenting a mesh distorts the mesh

I just came up with another issue in Unity3 (3.000f2). When you parent a mesh with a box collider and a rigidbody to some gameobject with a boxcollider (e.g a movable platform, implemented like it’s shown in this video http://www.youtube.com/watch?v=K5ObDagGZjI) then the parented mesh gets heavily distorted when unparenting it. When use use a builtin cube as mesh, it doesn’t get distorted though. I have set up a small project with two cubes, one is the builtin cube and one is made with a mesh from blender. Both cubes fall on a movable platform. Since they hit the edge of the platform they will slide off and leave the platform. While the builtin cube is unparented without issues, the mesh deforms in totally crazy ways when being unparented.

Sometimes the box is even deformed in a way that is actually impossible to achieve with scale, it turns into a parallelepiped (Parallelepiped - Wikipedia).

This really looks like a bug to me. Has anyone else had this issue?

391687--13451--$screen_shot_2010_09_22_at_230200_196.png
391687--13452--$screen_shot_2010_09_22_at_230234_133.png
391687--13453--$screen_shot_2010_09_22_at_230253_439.png

bug case number or it didn’t happen ;-). Attach small repro project and we will look into it

Bug case number is: 375309, TicketID: 375309_dn0a56kd. I have attached the sample project when submitting the bug :slight_smile:

as a workaround (while we are in the middle of fixing or updating the docs ;-)) set uniform scale for your movable platform - it will work correctly this way

The idea is - when parenting to mesh we try to preserve overall appearance (world position/rotation/scale). In your case you have scale (non-uniform) applied to parent, so we change local scale to compensate for it. After you un-parent it - your local scale is not restored to initial value, so you get your object skewed. So for now you have two options: don’t use scale on objects you want to parent/unparent or save initial scale to somewhere and restore it manually. Hope it helps.