Linear velocity should do the trick.
What linear velocity does is force a part to have the exact velocity it is set at as long as it is enabled.
Having something like:
if Dodge == true then
LinearVelocity.Enabled = true
LinearVelocity.VectorVelocity = Vector3.new(10, 0, 0)
wait(2)
LinearVelocity.VectorVelocity = Vector3.new(0, 0, 0) --resetting the velocity will stop the player from flying--
wait(0.1)
LinearVelocity.Enabled = false
end
This happens because the ground has friction. You can bypass it temporarily by using custom physical properties.
local NoFriction = PhysicalProperties.new(0.7, 0, 0.5, 100, 1)
local copies = {}
--Settings No friction
for i,v in pairs(character:GetDescendants()) do
if v:IsA("BasePart") then
copies[v] = v.CustomPhysicalProperties
v.CustomPhysicalProperties = NoFriction
end
end
--Settings it back to default
for i,v in pairs(character:GetDescendants()) do
if v:IsA("BasePart") then
v.CustomPhysicalProperties = copies[v]
copies[v] = nil
end
end
You may need to tinker the values but this works for me. I’d change the Velocity of the pusher to something lower as this is pretty much close to no Friction. It will push you until you go too far, or until you set the friction back to default.
Turns out I had to change the PhysicalProperties of the baseplate rather than my character. Not sure why that is or if there’s a way to do it with just my character. The problem is that I’ll have to find which floor my character is running on and change those properties.