ive got two problems ive spent a while trying to figure out the answer to and cant find anything that works online. my first problem is when using a LinearVelocity to move the player the player starts rotating (https://gyazo.com/5b7b04363214980b63ebd01153f5350b), im not sure why it happens and havent found any solutions. my second problem is im not sure how to stop the players momentum from a linearvelocity (https://gyazo.com/5013ba49759032e1050d535d3fd18d5b). ive tried anchoring the humaniod root part, setting the players parts to massless, setting the root part linear velocity to 0 , changing player state and none of it seems to work.
heres how im using the linear velocity:
repeat
char:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.None)
local num = 0 - dashP.Value
velocity.VectorVelocity = Vector3.new(num,0,0)
dashP.Value -= previousDA / 10
char:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.None)
task.wait(0.25)
until dashP.Value <= 0
anim:Stop()
velocity.VectorVelocity = Vector3.new(0,0,0)
velocity.Enabled = false
its just a loop setting the velocity to something that can go from 1 to infinite using some equation but so far the most has ever been 1 billion before the equation which the amount doesnt seem to do much for it. the loop sets it high and then repeats decreasing it to slow the player down until it becomes 0 and the player stops completely and the velocity is completely stopped.