Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a lerp have an arch in i?

I'm trying to make my lerp go in an arch like a parabola to make my throwing effect seem more realistic. Is there any way to do this? Or would it be better to use something else instead of lerp to "throw" something.

Here's my script so far:

game:GetService('RunService').Heartbeat:Connect(function(step)
		Handle.CFrame = Handle.CFrame:lerp(Position,step/speed) --basic lerp
end)

1 comment

0

"lerp"

1 answer

✓ Accepted answer

No, you cant make lerps have arches. Currently, there are two ways to do it, the built in pyshics engine, or scripted behavior.

The first option is just letting the engine let the part arch and fall down normally.

scripted behavior is the second option. Essentially, set up a while true do loop and do something like this.

I made this script increase and decrease hieght in an arch. You have to script the foreard velocity part because i dont know how you want that and because this is scripting helpers.

part = -- the part

X=-5 -- First x intersept

lastX = last X intercept

while true do
X= X+ 1
-- BTW, if you want, incorporate lerps into here
Part.CFrame.Y  = -1*(X*X) --Edit this equation to whatever you want
if X == lastX then
break
end
wait(0.1)--Put your wait
end

1 comment

0

Thank you for the insight! I didn't know it wasn't possible with lerp.

This discussion is preserved as it was. New answers, comments, and votes are closed.