Hey so I’ve created a interpolated bezier curve thing and everything is working but the problem is that im trying to create multiple parts on the curve but like there staying in the same spot, im just not sure how to fix it so it can work with any amount of parts and just flow like a stream?
The code:
local totalDuration = 1
local elapsed = 0
game:GetService("RunService").Heartbeat:Connect(function(dt)
local p1 = workspace.p1.Position
local p2 = workspace.p2.Position
local p3 = workspace.p3.Position
elapsed = elapsed + dt
local t = math.clamp(elapsed / totalDuration, 0, 1)
if t >= 1 then
-- right heree
for i = 1, 2 do
local newDroplet = droplet:Clone()
newDroplet.Position = p1 + Vector3.new(0,0,0)
newDroplet.Anchored = true
newDroplet.Parent = workspace.Droplets
end
elapsed = 0
else
for i,v in ipairs(workspace.Droplets:GetChildren()) do
v.Position = BezierLerp(p1,p2,p3,t)
end
end
end)