Problem: Rigid Body deformed after collision

I am new to Unity and is experimenting the physics engine.
I’ve just got a strange scenario that :-

I’ve write a simple project with a plane at ground, a rectangle rigid body is put somewhere
in the air. Under it is an cylindrical rigid body. When start to play, the two rigid body drop and collide at the floor plan.

Strange thing is that if I put the cylinder as child of the rectangle block, the cylinder will
deform after it collide with the rectangle block.
This won’t happen if the cylinder is NOT put as child of the rectangle.

Would anybody explain why this happen ?
Attached is the complete playable project.
Thanks

2324542–156867–dynamic.zip (460 KB)

This is because when you have a child of a parent that has non uniform scale, and you rotate the child, it will deform because of the scaling of the parent.

The collision naturally rotates the child.

To avoid this you must first unparent or just have parent with scale that is uniform ie 1,1,1 or 5,5,5 etc… NOT 1, 2, 1 or such.

Thanks for your explanation. In that case, I may try creating another empty object to hook the relation between the rigid bodies.
Btw, it there any way to re-scale a mash object without using the transform tool within unity ?

The is a few mesh resize code snippets around but you’d have to search for them or write your own, which simply multiples mesh vertices by a scaling factor and applies them back to the mesh.

Unity doesn’t support mesh scaling out of the box in the inspector. It supports transform scaling. It’s a entirely different thing.

A gameobject and transform are always there but for a mesh to be rendered it needs to have a mesh filter and mesh renderer component, optionally added.

Rigidbodies shouldn’t have parent-child relations in the first place.

1 Like

I’m not aware of any conditions which prevent you using child/parent relationships providing one or the other doesn’t also have a rigidbody, but if your aim is to stick them together, try FixedJoint.

I mean, between rigidbodies themselves.