Aligning Two Objects

I have the following setup that I can’t figure out and was hoping for some help. I included a screen grab below so you can see exactly what the issue I’m dealing with is. The user will click and drag on a rectangular box-like object, then drag it and release it into a target. The target is basically a bigger box, with no top so that the they can drop the first box in it.

My issue is that when the smaller box is dropped into the bigger box and hits the bottom of the bigger box, I need it to change its rotation and position so that it is nicely centered in the bottom of the bigger box. I have tried all sorts of tricks with setting the rotation of the small box to that of the bigger box, as well as using transform.LookAt, however with no luck.

Thanks in advance for any help.

im not sure of this, its just something that came into my head

maybe in the bigger box put a trigger slighly taller than the visible box, and when the other box touches it , copies the position and rotation,but not scale of the trigger to the smaller box, and then falls into the bigger box, with proper orientation

just some ideas, hope this helps 8)

Yes, that’s what I would do.

You could even make the smaller box become a Child of the larger box when it touches it, so you’ll know for sure that position(0,0,0) and rotation(0,0,0) on the smaller box will be in the centre of the larger box.