Move object to the edge of another object

Hi,

I would like to get the location of the edge of an object (red). I would then want to set location of another object (green) to that edge. However, I can’t use a default offset since the red object doesn’t always have the same size (Y-value changes). Also the sphere may also appear on the right side in certain situations. The sphere is also used elsewhere so I can’t really attach it (fixed) to the edge of the cube so it should be done at runtime.

How could I get the location of the edge of that object?

Thanks for all your advice and suggestions.

How about this?:

311419-edge.gif

Hi ClockworkOcean,

that looks exactly what I need. Reproduced it myself and it works indeed.

Thanks a lot for your help! Really appreciate it.

With kind regards,