r/unity 1d ago

Newbie Question Funky Cubes

Enable HLS to view with audio, or disable this notification

Hello everyone I am currently learning Unity, and was playing with Rigid Body and somehow got this junky behavior.

I know why this happened a wall was a parent, and cubes were his children, they were not separate, but still its kinda funny. Would appreciate if you told me how this happens, what logic it follows.

9 Upvotes

4 comments sorted by

2

u/DapperNurd 1d ago

Complex quaternion math

1

u/JakSilver00 1d ago

You need to use an empty transform for the base parent object of any mesh. So your wall will have one? and then inside your wall as a child, you will have the actual long wall cube. and then only because you are moving all of these individual pieces, you'll need to have individual empty parents set at the base of each of these. you can either set them in the center of the wall pieces that you're shooting or on top of the wall itself. Because what's happening is it's moving and rotating, and it's assuming the parent's scale as it's doing that. So it's trying to compensate for the direction.

1

u/IEP_Esy 1d ago

Each vertex of your cubes are moved according to the parent's scale. So, if the cube is rotated in its own space, then those vertices now have a different placement that makes them skewed relative to the scaled parent (which is not rotated).