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 1 year 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 1 year ago
Edited 1 year 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 — 1y
0
Oh, sorry! It's actually .MoveDirection. I made a mistake when posting my answer. Meeptey2 51 — 1y
Ad
Log in to vote
0
Answered by 1 year 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 — 1y

Answer this question