How to kill momentum

How can I, via script, kill a part’s momentum?

Depends on how that momentum is created.

If it’s through physics, you can use constraints, change the part’s AssemblyLinearVelocity, anchor the part, etc.(There are many ways to do this you can choose from. It depends on the context you’re trying to kill the momentum in)

If the momentum is created through a script(By changing the position using RunService/TweenService, etc.), you have to build in the ability to do that in the script, that moves the part.

You can kill a part’s momentum by setting their linear velocity and angular velocity to zero.
Here’s an example:

local part = workspace.Part -- change this to your part
-- Vector3.zero is the same as Vector3.new(0,0,0).
part.AssemblyLinearVelocity = Vector3.zero -- linear velocity
part.AssemblyAngularVelocity = Vector3.zero -- angular velocity

Works in server scripts. Remember that this only works if the part’s Network Ownership is set to nil. (owned by server)

2 Likes

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