Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago

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

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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

if *HUMANOID*.MoveDirection ~= Vector3.zero then
    -- whatever
end
0
"WalkDirection is not a valid member of Humanoid "Workspace.iiDevPanda.Humanoid", what's the issue here? PandaKeai 10 — 2y
0
Oh, sorry! It's actually .MoveDirection. I made a mistake when posting my answer. Meeptey2 51 — 2y
Ad
Log in to vote
0
Answered by 2 years ago

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.

0
This answers my question too! Thanks. PandaKeai 10 — 2y

Answer this question