This script was given to me by someone here in Devforum, but I don’t have a clue what this part of the script means. It’s the only thing that needs clarification.
local TargetPosition = QuadraticBezier(t , Position_Start, (CFrame.new(Midpoint)*Random_Offset).p, Position_End);```
Random offset is a vector 3 and controls the curviness of the bezier curve as point p1 in the image below.
Currently it’s within the midpoint of p0 and p2 from CFrame.new(Midpoint) which makes it not as curvy. Consequently thats why its multiplied by Random_Offset in order to create the curve.
I believe it’s overcomplicated though. You could just do this to create and offset and create the curviness.
local Random_Offset : Vector3
Midpoint + Random_Offset