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 7 years ago

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

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

1 answer

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

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

1local humanoid = script.Parent.Parent.Parent:WaitForChild("Humanoid");
2 
3humanoid.Changed:Connect(function()
4    script.Parent.Acceleration = humanoid.MoveDirection
5end)
Ad

Answer this question