This is a simple but challenging topic, How can I prevent this part from moving? Is it possibe? Only using ApplyImpulse? and yes, it obviously works with the Vector Force.
Here’s my code.
local Part = workspace.Part
local Gravity = workspace.Gravity
local Mass = Part.AssemblyMass
game:GetService("RunService").Heartbeat:Connect(function(delta)
local CounterGravityForce = Vector3.yAxis * Mass * Gravity
local CounterForce = -Part.AssemblyLinearVelocity * Mass
Part:ApplyImpulse((CounterForce+CounterGravityForce)*delta)
end)
Opposing gravity is easy ( Up * Mass * Gravity ). Although opposing motion effectively is much harder, for some odd reason i tried damping it but it didn’t work. Just opposing motion means it now acting in “Zero Gravity” or Newtons First Law becoming true.
-- In a loop...
CounterGravity = Up * Mass * Gravity
CounterMotion = -Velocity * Mass --needs work.
he’s probably trying to just get it to float??? if thats the case i dont know why he would want ALL motion to cease, unless he just wants rotation, in which case just use an alignposition instance.
Coyote time usually just means a short delay before gravity is applied, and only when running off edges or over short gaps. You wouldn’t use ApplyImpulse for this, or affect any direction besides up/down. More generally, you don’t want to use ApplyImpulse every frame for freezing something, you’ll get instability, at least with Heartbeat or using Stepped with the default adaptive timestep. ApplyImpulse is intended for one-time use to kick something. VectorForce is for applying continuous force over time.