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

How to make particle acceleration equal to Player Humanoid MoveDirection???

Asked by 6 years ago

07-11-2017 01:15 AM I tried doing this, but it does nothing at all, with no errors in output, HELP!!!

wait(2)
local humanoid = script.Parent.Parent.Parent:WaitForChild("Humanoid")
script.Parent.Acceleration =  humanoid.MoveDirection

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
6 years ago

You have to actively update the variable.. humanoid.MoveDirection will always be 0, 0, 0 at spawn. Use the Changed event? :D

local humanoid = script.Parent.Parent.Parent:WaitForChild("Humanoid");

humanoid.Changed:Connect(function()
    script.Parent.Acceleration = humanoid.MoveDirection
end)
Ad

Answer this question