You can use bezier curves to draw something like this, however in your case the midpoint at the top of the arc should go “up” relative to the world and not “right” relative to the CFrame.lookAt from current position to target position.
Details on the method
So here is how it goes I believe:
--percent1,percent2 = 0.25, 0.25
--1/4 of the length of the positionToLookAt vector
local function bezierCurvePoints(position,lookAt,upLength,percent1,percent2)
local upVector = Vector3.new(0,1,0)
local positionToLookAt = lookAt-position--vector from position to lookAt/Target point
local unitDirection = positionToLookAt.Unit
--find the right vector relative to the world
local rightVector = positionToLookAt:Cross(upVector).Unit
--find the new upvector
local upVector = rightVector:Cross(unitDirection).Unit
local midpoint = position+positionToLookAt/2
--right length influences the length it goes "right"
local midpointToTheSky= midpoint + upVector *upLength
local p2 = midpointToTheSky- positionToLookAt*percent1
local p3 = midpointToTheSky+ positionToLookAt*percent2
return p2,p3
end
Then apply the cubic bezier curve equation with p2 and p3
function cubicBezier(t, p1, p2, p3, p4)
return (1 - t)^3*p1 + 3*(1 - t)^2*t*p2 + 3*(1 - t)*t^2*p3 + t^3*p4
end
Another option is to use the quadratic projectile motion equation to model the arc, it should also be more physics like if you are going for a more realistic approach.
