Ice-walking effect for player

Hey yall!

I need to make the character for my game to keep their momentum when moving (to put it in other words, move like they’re on ice), but without altering the physical properties of the map, since there are other players who cannot be affected by it.

I’ve searched far and wide in the devforum but could not find anything that works (changing the character’s PhysicalProperties, putting a part under the player with icy phisical properties, etc.)

Does anybody know a way I could achieve this?

I fiddled around with the humanoid but I couldn’t find any way to disable friction so in the end I just settled on calculating the velocity manually

I basically store a velocity value and accumulate velocity based on the character’s movement direction, and multiply it by a number smaller than 1 to apply air drag/damping

local RunService = game:GetService("RunService")

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

local velocity = Vector3.new()

RunService.Stepped:Connect(function()
	velocity += humanoid.MoveDirection * 0.4
	velocity *= 0.996
	humanoidRootPart.Velocity = Vector3.new(velocity.X, humanoidRootPart.Velocity.Y, velocity.Z)
end)

In StarterCharacterScripts

1 Like

Perhaps this could help if you set the acceleration to a low value.

1 Like

Works perfectly, thank you so much!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.