Curvature help needed


i want to acheive this effect.

Theres 3 parts
i want smooth curves, so a red part spawns from the part1’s direction, while the other spawns from the part3’s direction, and ends up around the part2, very hard to explain, but the picture should help.

Any math help would be prefered!

of what im thinking would work, cframe.lookat(orginpos,midpos).cframe.z - midpos.cframe.z might be the best, but there would be some rotation problemos there

wait no
cast a ray from midpos to both directions?

What your asking is kind of confusing, there are the 3 parts you talking about (which I assume are the grey parts with the decals). And then there are the red parts. Which red parts are you talking about? The arrow or the semi transparent one?

yes, quite indeed semi-confusing

what i am trying to acheive is making the red big parts auto-placed, close to the result in the picture, but ofc, script generated.

the arrows are irrelevant, just for vizualisation

Never mind folks! I found the solution!

local lookat1 = CFrame.lookAt(MidPart.Position,PartBefore.Position)
local lookat2 = CFrame.lookAt(MidPart.Position,PartAfter.Position)

local x1,y1,z1 = lookat1:ToOrientation()
local x2,y2,z2 = lookat2:ToOrientation()

x1,y1,z1,x2,y2,z2 = math.deg(x1),math.deg(y1),math.deg(z1),math.deg(x2),math.deg(y2),math.deg(z2)

local pos1 = CFrame.new(lookat1.Position) * CFrame.Angles(math.rad(x1),math.rad(y1),math.rad(z1))
local pos2 = CFrame.new(lookat2.Position) * CFrame.Angles(math.rad(x2),math.rad(y2),math.rad(z2))

pos1 = pos1 * CFrame.new(0,0,-3)
pos2 = pos2 * CFrame.new(0,0,-3)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.