CLICK FOR PICTURE So in that picture there's a brick with two CFrames colored in blue. What I want to do is CFrame the gray brick so that it attaches between the two green points, therefore making the brick occupy the red area. Problem is, everything I try to get the green points won't work for me, so I came here for help. I already tried Lerping the CFrames but it just goes to the same exact spot every time. ANY help is greatly appreciated. Thanks!
I believe this will work:
local to = red.CFrame:vectorToObjectSpace( Vector3.new(0, 1, 0) ) green.CFrame = red.CFrame * CFrame.new(Vector3.new(), to * Vector3.new(1, 0, 1))
The idea is determining which way is "up" relative to where it was, and then rotate towards that, but only around the Y axis.