here is my code, I am only giving this function the values of
MaxDistance = 200
MaxHeight = 100
for now.
local function DisplayCurve(MaxDistance, MaxHeight)
for i,v in pairs(Curves:GetChildren()) do
v:Destroy()
end
local x = 0
local m = 0.01
local y = m * (x^2) + MaxHeight
local BallPos = GetPlayerBall().Position
local first = CurvePoint:Clone()
first.Parent = workspace.SwingCurves
first.Position = BallPos
local PreviousPoint = first.Position
repeat
x -= 1
y = m * (x^2) + MaxHeight
local Point = CurvePoint:Clone()
Point.Parent = Curves
Point.Position = PreviousPoint + Vector3.new(0,y,x)
PreviousPoint = Point.Position
print(y)
wait(0.1)
until #Curves:GetChildren() == 100
end
SwingFullTrack:GetMarkerReachedSignal("BallContact"):Connect(function(paramString)
DisplayCurve(200,100)
end)
and it only creates 100 parts, but I am planning to change that later.
the curve is supposed to reach 100 at the top, and come back down to 0 at x=200, but right now y just increases into the thousands.
y=2600 when x = 500 (i removed the until statement to let it get that high)
Try using Point.Position = Vector3.new(0,y,x) instead? Adding the PreviousPoint is why the curve keeps multiplying, but after running it I got a really weird curve so I assume I did something wrong