I’ve just came across a youtube video where you can use bezier curves and I wanted to give it a try, so I opened studio and it worked amazingly. I wanted to try this on my current project and it’s a bit different since the game has models and not parts. I didn’t think it would be an issue since I can just use the primary part, but I put in the code and nothing happens. I’m basically just trying to lerp the model from 1 position to the other. I have a part that spawn 50 studs out on the Z axis so it can curve to the player, but nothing seems to happen, I thought it may be from the PrimaryPart, but I have no idea.
Here is the code I used:
UpdateClient.OnClientEvent:Connect(function(ingredientInstance)
local hasTool = checkForTool(plr)
if hasTool then
local bopSound = Instance.new("Sound")
bopSound.SoundId = "rbxassetid://10254751627"
bopSound.PlayOnRemove = true
bopSound.Parent = script
local fruitVal = ingredientInstance
local HRP = plr.Character.HumanoidRootPart
if fruitVal ~= nil then
local char = plr.Character
local HRP = char.HumanoidRootPart
bopSound:Destroy()
local lerpPart = Instance.new("Part", workspace)
lerpPart.Name = "lerpPart"
lerpPart.Position = fruitVal.PrimaryPart.Position + Vector3.new(0, 0, 50)
lerpPart.Color = Color3.fromRGB(0,0,0)
lerpPart.Anchored = true
lerpPart.Massless = true
lerpPart.CanCollide = false
for i = 0, 10, wait() do
local t = i / 10
local l1 = lerp(fruitVal.PrimaryPart.Position, lerpPart.Position, t)
local l2 = lerp(lerpPart.Position, HRP.Position, t)
local quad = lerp(l1, l2, t)
fruitVal.PrimaryPart.Position = quad
task.wait(1)
end
end
end
end)