I have made lots of progress yet there is an issue I can’t seem to fix. If the parts size is not congruent on the x and z axis the arc is not continuous, as can be seen bellow
I am having issues getting the leading face of the next part to face in the same direction as the last. In my attempt to fix this I just rotated the part by -90 radians, but then the issue shown above pops up.
My code:
local Angle = 100
local LastPart = workspace.Part0
for Index = 1, 3, 1 do
local NewPart = LastPart:Clone()
NewPart.Name = "Part" .. Index
local Point = NewPart.CFrame * CFrame.new(NewPart.Size.X / 2, 0, NewPart.Size.Z / 2)
local Offset = CFrame.new(LastPart.Size.X / 2, 0, LastPart.Size.Z / 2)
NewPart.CFrame = (Point * CFrame.Angles(0, math.rad(Angle), 0) * Offset) * CFrame.Angles(0, math.rad(-90), 0)
NewPart.Parent = workspace
LastPart = NewPart
end
If you know how to fix the issue I would love your help, thanks.
local Angle = 100
local LastPart = workspace.Part0
for Index = 1, 3, 1 do
local NewPart = LastPart:Clone()
NewPart.Name = "Part" .. Index
local Point = NewPart.CFrame * CFrame.new(NewPart.Size.X / 2, 0, NewPart.Size.Z / 2)
local Offset = CFrame.new(LastPart.Size.X / 2, 0, -LastPart.Size.Z / 2)
NewPart.CFrame = (Point * CFrame.Angles(0, math.rad(Angle - 90), 0) * Offset)
NewPart.Parent = workspace
LastPart = NewPart
end
The rotation for the new parts for some reason kept rotating perpendicularly to the old part. I saw you mitigated that by rotating the end result by 90 degrees, which seemed to break whenever the part was a square.
Any possible way to create arcs combining two X and Y axes? For example creating a coil? Scriptos’s plugin for arcs allows curvature in only a singular axis at a time and it gets a bit frustrating.