madzhis1
(Madzhis)
November 5, 2023, 11:57am
#1
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:
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
madzhis1
(Madzhis)
November 5, 2023, 2:42pm
#2
if im not mistaken this isnt how the quadraticbezier curve works…
1 Like
Katrist
(Katrist)
November 5, 2023, 3:53pm
#3
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
madzhis1
(Madzhis)
November 5, 2023, 4:08pm
#4
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
system
(system)
Closed
November 19, 2023, 4:08pm
#5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.