If you wanted to create a line (made of a part) between 2 points how would you find the needed rotation?
If you want just a straight line, ROBLOX already has a CFrame constructor for you to use, as well as the nifty Lerp
method of Vector3s.
local p1 = workspace.Part1.Position local p2 = workspace.Part2.Position --These are your two given 'points' Both are Vector3s local part = Instance.new("Part", workspace) part.FormFactor = Enum.FormFactor.Custom part.Size = Vector3.new((p2 - p1).magnitude, .2, .2) --IIRC 'x' is the lookVector axis. The other two define the thickness of the line. local midP = p1:Lerp(p2, .5) --math part.CFrame = CFrame.new(midP, p2) --more math. Isn't this fun?
If the part you're creating is an arrow mesh or some other thing where the point it's actually facing is important, you can change the p2
in that last line to p1
to point it at that position instead.