I want to create a dash effect like in this game:
I tried doing this but it doesn’t have the same effect:
local module = {}
local player = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
function module.movement(input, gameProcess)
if gameProcess then return end
if input.UserInputType == Enum.UserInputType.Keyboard then
local velocity = Vector3.new(0, 0, 0)
if input.KeyCode == Enum.KeyCode.A then
velocity = velocity + Vector3.new(-5, 0, 0)
end
if input.KeyCode == Enum.KeyCode.D then
velocity = velocity + Vector3.new(5, 0, 0)
end
local currentCF = player.Character:GetPivot()
local nextCF = currentCF + velocity
player.Character:PivotTo(nextCF)
end
end
return module
Here is what it looks like in my game:
Not sure how I would go about doing this, any help would be appreciated.