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

I'm trying to decelerate a BodyForce but it goes way too fast?

Asked by 4 years ago

So I am making a grenade and I used a BodyForce to propel it whenever the player clicks. The thing is, drop and everything is correct except it is going way to fast. I have a for loop that decreases the amount of speed it takes by dividing it.

Basically I'm trying to decelerate overtime for the BodyForce, but it ends up going way too fast.

Here is the for loop:

local BodyForce = Instance.new("BodyForce", fakeGrenade)
local TargetPoint = Humanoid.TargetPoint 
BodyForce.Force = Humanoid.TargetPoint * 10

for i = 1, 20 do
    BodyForce.Force = (BodyForce.Force / i)
    print(fakeGrenade.Position)
    --Timer(0.3 * i)
    wait(0.1)
    print("Fired grenade at the speed level of "..i)
end

Thanks for viewing this!

1 answer

Log in to vote
0
Answered by
Robin5D 186
4 years ago

Try printing the .Magnitude of the Humanoid.TargetPoint. If it's higher than 1, then your problem is that you're not getting the .Unit of TargetPoint.

Try this:

BodyForce.Force = Humanoid.TargetPoint.Unit * 10
0
For some reason it didn't work, how else could I slow down the grenade? 123nabilben123 499 — 4y
Ad

Answer this question