this is very specific but,
i want to find the distance between the left side of RedPart and the right side of BluePart
how would i do that?
this is very specific but,
i want to find the distance between the left side of RedPart and the right side of BluePart
Need more info about possible positions and rotations of the parts. This could range from really easy to really hard depending on that info.
Some ideas about how you could define it. If the faces being mesured between are always parallel, there is always one answer. If not, then there is some range of distances and you must decide on some definition, such as the closest approach between faces.
something like this should work
local redLeft = redPart.CFrame * CFrame.new(-redPart.Size.X/2, 0, 0)
local blueRight = bluePart.CFrame * CFrame.new(bluePart.Size.X/2, 0, 0)
local distance = (blueRight.Position - redLeft.Position).Magnitude