How to stop/cancel ApplyImpulse()

I just made a part that can be thrown, so I used ApplyImpulse(). But the problem is that I want the part to stop from going in the same direction as ApplyImpulse() did to it. I mean that when I even anchor the part and unanchor it nothing happends instead of doing the same thing.
I want to make it falling down correctly and not still going forwards

What it does…


What do I want it to do so…

Please help me :frowning:

This script excutes for the part but the ApplyImpulse is used from another script

while wait() do
	local params = RaycastParams.new()
	params.FilterType = Enum.RaycastFilterType.Exclude
	params.FilterDescendantsInstances = {part}
	local raycast = workspace:Raycast(
		part.Position,
		Vector3.new(90, 0, 0) * 150,
		params
	)
	if raycast then
		lastPos = part.Position
	else
		part.Anchored = true
		part.Position = lastPos
		part:ApplyImpulse(Vector3.new(0, 0, 0) * 0) -- This is what i tried...
		wait(2)
		part.Anchored = false
	end
end
1 Like

You should be able to completely reset a part’s velocity by doing

part.AssemblyLinearVelocity = Vector3.zero
1 Like

Thank you so much! It worked! :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.