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

How can I make a body force decelerate?

Asked by
synkrio 281 Moderation Voter
4 years ago

I'm making a rocket launcher that allows you to rocket jump. The knockback is created by a body force. The problem here is that body force accelerates, which is the opposite of what I want. Is there a way to make body force decelerate or should I use a body velocity and script it to slow down over time?

1 answer

Log in to vote
0
Answered by 4 years ago

I'm not familiar with bodyforces but you could use a count down for loop. It goes like this:

for i = 100, 1, -1 do
    wait(0.6)
    bodyforce.Force = i 
end

The 100 is the start, the 1 is the end, and the -1 is the deceleration. By default for loops go up by one. Again my answer is probably not correct. You could use any time of loops but for loop is the most preferable.

You can ask clarification anytime.

Ad

Answer this question