I'm looking for a way to have a script sense when a player changes their direction drastically while running, so that it can play a skidding animation. I started off with this local script, but it is not a good way to handle it at all.

local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

while true do
	local direction = humanoid.MoveDirection
	wait(0.1)
	if humanoid.MoveDirection == direction * -1 and humanoid:GetState() == Enum.HumanoidStateType.Running then
		print("skid!")
	end
end

I'm not sure how else I could approach this. Any ideas?

1 comment

0

I think you should create an animation and alter the walkspeed.