Abb2t
(Abb2t)
#1
Ok, so I got 3 Parts:
- Red
- Blue
- White (Created with a Script)
I already found the mid-Vector3 by doing:
White.Position = (Red.Position + Blue.Position) / 2
See Here:
Now I’m trying to correctly orient the White part so it is in line with the Red and Blue parts.
Like this:
Do you know an equation that can do this?
You can just do:
Line.CFrame = CFrame.new(Blue.Position, Red.Position) + MidPoint.Position
Basically, you get the lookvector of the 2 points and add it to the position with CFrame.new((Pos1, PosLookAt)
Abb2t
(Abb2t)
#3
But how does this get the Orientation?
It’s documented on the developer hub:
2 Likes
Abb2t
(Abb2t)
#5
Thanks, bro! I hope others come across this.
1 Like
ADUPS
(ADUPS)
#6
You can also do
local LookAt = (Part1.Position - Part2.Position).Unit
to get the LookVector between 2 parts
1 Like