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

How to make an animation play when a player is walking/running?

1 answer

✓ Accepted answer

You can do HumanoidStateType. Or you can check for velocity. I have omitted the scripts that play the animation, because I am a lil lazy and it seems you already know how to do that. In a localscript, in the character model of each player (put script in starter character scripts)

while true do
local vel = script.Parent.HumanoidRootPart.Velocity
local speed = ((vel.X)^2 + (vel.Z)^2) ^(0.5)
	if speed >= 16 then
		-- Play Run Anim Script
	else if speed <16 and speed >= 0. 1 then
		-- Play Walk Anim Script
	else 
		-- Play Idle Anim Script
	end
	end
	end
wait()
end

Mark as answer if this solves your question. If this isn't what you intended, comment on this an I will get back to you ASAP.

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