Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is the best way to make a player dash left or right?

I'm trying to make a script to dash left or right. So far it works but not as good as I want.

Dash = function(velocity, anim)
  local bodyV = Instance.new("BodyVelocity", char.HumanoidRootPart)
  bodyV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  bodyV.P = 100
  bodyV.Velocity = velocity * 60
  game.Debris:AddItem(bodyV, 0.2)
  anim:Play()
end

This is the code I'm using. The problem is that if I dash when I'm on the ground I move very little but if I jump and dash I move further. How can I make it so that it always dashes the same distance even if I'm jumping and in the same amount of time?

1 answer

You could try not using a BodyVelocity object. Change the Humanoid's statetype to RunningNoPhysics and adjust the HumanoidRootPart's velocity relative to the direction you want to dash.

This discussion is preserved as it was. New answers, comments, and votes are closed.