How do i get the rotation along a beam using the rotations of the attachments and the beam curve size
ive tried looking at How can I get a CFrame along a BEAM? but i dont know how they got the rotation and how to get the normal along the beam and i have already calculated the positions
this is the script currently
local function getPoints(beam:Beam):{Vector3}
return{beam.Attachment0.WorldPosition,
beam.Attachment0.WorldPosition+beam.Attachment0.WorldCFrame.RightVector*beam.CurveSize0,
beam.Attachment1.WorldPosition-beam.Attachment1.WorldCFrame.XVector*beam.CurveSize1,
beam.Attachment1.WorldPosition}
end
local function bezier(points:{Vector3},t:number):Vector3
if#points==1 then
return points[1]
end
local newPoints={}
for i=1,#points-1 do
newPoints[i]=points[i]:Lerp(points[i+1],t)
end
return bezier(newPoints,t)
end


