Basically, I’m trying to slow a part down until it stops completely. I have a part that gets set a BodyPosition and gets it deleted shortly after, and a repeat until loop that removed 1,1,1 vector off the part’s velocity every second, but that didn’t change the velocity, and with a few edits, it increased velocity instead(?). I’ve tried doing a for do loop and a while true do loop, but neither of these changed. 3 days in and I’ve tried a ton of different formulas and none of them worked (the closest I got was with a for do loop that subtracted velocity by .005 or so, with the timing being way off than the original function). So I’m asking you all, how in the world are you supposed to lower a velocity if none of the loop functions work properly, or the velocity just doesn’t change at all? (The bodymover I’m using is BodyPosition).
Maybe instead you should use a bodyforce/bodyvelocity? Or maybe instead of doing both of those you could use the Velocity
property of the part.
If an object is in motion, you can just use a BodyForce which opposes the velocity of an object to slow it down. Calculate the force needed to achieve a desired de-acceleration with f=ma.
Set the BodyMover Velocity to -part.Velocity
Why would you want the Velocity to just be flipped? BodyVelocity is essentially just a P(D) controller, so doing this will impart an arbitrary deceleration force. Why not just impart your OWN force which you can control exactly? Furthermore, even if BodyVelocity had instantaneous and perfect feedback and response, then all you would get is an oscillating movement. To get it to stop, you are hoping that there is some inherent dampening or phase-lag exists in the system.
I added this script to the part which I want to slow down;
local part = script.parent
while wait() do
part.AssemblyLinearVelocity = 0.6 * part.AssemblyLinearVelocity
part.AssemblyAngularVelocity = 0.6 * part.AssemblyAngularVelocity
wait(0.2)
end
You can change the wait time and “0.6” to arrange slow down speed