Hello. I have a pathmaking script that uses waypoints to create paths.
As you can see, it does not create a desirable result on the corners:
The pathbuilding uses this formula for the orientation: (modified to work with Cframe EulerAngles)
atan2(Δx, -Δz)
atan2(Δy, √(Δx^2+Δz^2))
The pathbuilding also uses the 3D Distance Formula and 3D Midpoint Formula.
Code so you don’t have to type all of it out:
local w1 = game.Workspace.waypoint1namehere -- Waypoint #1
local w2 = game.Workspace.waypoint2namehere -- Waypoint #2
local yaw = math.atan2(-(w2.Position.X - w1.Position.X), -(w2.Position.Z - w1.Position.Z))
local pitch = math.atan2((w2.Position.Y - w1.Position.Y), math.sqrt((w2.Position.X - w1.Position.X)^2 + (w2.Position.Z - w1.Position.Z)^2))
Maybe the formulas doesn’t matter in the final solution? I’m thinking it could calculate each corner after the paths have been laid out.
The goal is to make the corners like this (the empty area will be filled with another wedge)


