Bezier Curve doesn't seem to curve right

I am trying to recreate the bezier curve throw from TreeLands, but It doesn’t seem to work for me. It worked when I had 3 sepereate models for each fruit, but I concluded that that wasn’t the best way to organize parts and I only use 1 part for each Fruit.

Basicly without these:
image

I’ve looked for a solution for the past 2 hours, but I haven’t found any.

Heres a video and a screenshot of the problem:

Heres the code I used

local Height = Vector3.new(((Part.Position+MouseCFrame.Position)/2).X, MouseCFrame.Position.Y + 10, ((Part.Position+MouseCFrame.Position)/2).Z)
	
	print("playing")
	for i = 0, 1, 0.01 do
		
		local partt = Instance.new("Part", workspace)
		partt.Size = Vector3.new(0.2,0.2,0.2)
		partt.Anchored = true
		
		local pos = quadraticBezier(i, Part.Position ,Height, MouseCFrame.Position)
		
		partt.Position = pos
		
		Part.CFrame = Part.CFrame:Lerp(CFrame.new(pos), i)
		task.wait(-i)
	end
	
	Part.Anchored = false
	Part	.CFrame = MouseCFrame
2 Likes

if im not mistaken this isnt how the quadraticbezier curve works…

1 Like

You’re missing the quadraticBezier code.

Can’t you also use the same code to move the apple as you did to make the trajectory outline?

1 Like

I’ve figured out how to fix this problem, I was always getting the parts position even when it was moving, I just needed the one position in the hand

local LastPos = Part.Position

for i = 0, 1, 0.01 do
		
		local partt = Instance.new("Part", workspace)
		partt.Size = Vector3.new(0.2,0.2,0.2)
		partt.Anchored = true
		
		local pos = quadraticBezier(i, LastPos ,Height, MouseCFrame.Position)
		
		partt.Position = pos
		
		Part.CFrame = Part.CFrame:Lerp(CFrame.new(pos), i)
		task.wait(-i)
	end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.