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

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

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

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

1 comment

0

For some reason it didn't work, how else could I slow down the grenade?

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