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

How would I be able to detect if a players lower leg is moving?

I'm trying to make an ice trail that follows a player as they move, but below them. How would I be able to detect if a players lower leg is moving so that I could duplicate the trail as they move?

2 answers

✓ Accepted answer

Try this, keep in mind this applies to the whole player, and not just the leg.

if *HUMANOID*.MoveDirection ~= Vector3.zero then
	-- whatever
end

2 comments

0

"WalkDirection is not a valid member of Humanoid "Workspace.iiDevPanda.Humanoid", what's the issue here?

0

Oh, sorry! It's actually .MoveDirection. I made a mistake when posting my answer.

Check the 'AssemblyLinearVelocity' of one of the left leg's parts. Example:

local leftLeg = character:FindFirstChild("LeftLowerLeg")

if leftLeg.AssemblyLinerVelocity ~= Vector3.zero then
	print("left leg is moving")
end

Also might be worth having a threshold for miniscule movements such as an idle animation.

1 comment

0

This answers my question too! Thanks.

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