Instead of using :ApplyImpulse
I used VectorForce
instead, I think it should be similar enough to :ApplyImpulse
as I based it off the documentation for ‘AssemblyLinearVelocity’
And then apply drag to it that way the force is equalized once you reach a speed threshold
The code I’m currently using:
RunService.Heartbeat:Connect(function()
ControllerManager.FacingDirection = HumanoidRootPart.CFrame.LookVector.Unit
local RootAssembly = HumanoidRootPart.AssemblyLinearVelocity
local HumVeloc = HumanoidRootPart.AssemblyLinearVelocity
local Impulse = (Humanoid.MoveDirection * desiredspeed^2) * rate
PlayerVelocity.Force = Impulse
local velocity = Vector3.new(HumanoidRootPart.AssemblyLinearVelocity.X, 0, HumanoidRootPart.AssemblyLinearVelocity.Z)
local speed = velocity.Magnitude
if speed > 0.1 then
Drag.Force = (-velocity.Unit*((speed)^2)*XZVector) * rate
else
Drag.Force = Vector3.new()
end
end)
It has 2 ‘VectorForces’ 1 controls movement and the other controls drag.
‘Rate’ makes it so you can adjust how snappy or slippery it is.
I still haven’t written a code for adjusting the velocity based on slopes and material friction. However, this should be a good basis for anyone looking for an alternative to linear velocity.