Hey dip,
are the objects rotated or not?
If not, you can use this function to check if one rectangle is inside another one.
--[[-------------------------------------------------------------------------------------------------------- Estimates if one rectangle (R1) with the center point R and a given width and height is completly inside another rectangle (R2) @param R1x, R1y - x and y cordinates of the first rects center point @param R1w, R1h - width and height of the first rect @param R2x, R2y - x and y cordinates of the second rects center point @param R2w, R2h - width and height of the second rect @return - true, if the first rect is completly inside the second one ----------------------------------------------------------------------------------------------------------]] local function rectInRect(R1x, R1y, R1w, R2h, R2x, R2y, R2w, R2h) R1x, R1y = R1x - R1w\*0.5, R1y - R1h\*0.5 return (R1x \>= R2x and R1y \>= R2y and R1x + R1w \<= R2x + R2w and R1y + R1h \<= R2y + R2h) end