Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Radstar1 270 Moderation Voter
6 years ago

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)
0
"lerp" chexburger 358 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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

0
Thank you for the insight! I didn't know it wasn't possible with lerp. Radstar1 270 — 6y
Ad

Answer this question