Placing mesh on another mesh

I have a moving mesh. Let call it Moving_Mesh and other meshes Mesh1, Mesh2,Mesh3.

These Mesh1, Mesh2, Mesh3 have different position.y values. And Moving_Mesh has some height H.

How do I set the value of Moving_Mesh.position.y so that it appears properly on all these meshses (Mesh1, Mesh2, Mesh3)

Problem:- Right now when set value of Moving_Mesh.position.y sometimes it appears to be in air for Mesh1 which have low position.y value and sometime it goes underneath for Mesh3 which have high Moving_Mesh.position.y value. I want it to be just placed properly over mesh not in air and not underneath

Are you able to reproduce your use case in the Playground?

It will be easier to understand what you want to achieve.

Without more information, I would say that setting Moving_Mesh.position.y = Math.max(Mesh1.position.y, Mesh2.position.y, Mesh3.position.y) + H/2 should do it (assuming Moving_Mesh is centered in its own local coordinate system).