Hello there, I’m making a floor particle script and the first part works just fine.
My problem now is that I want it to activate whenever the player moves and I don’t know how to do that.
If you could help me make a function that checks if the player is moving or not.
Thank you.
1 Like
Two ways you can detect movement, the Running
event or a GetPropertyChangedSignal
connected to the MoveDirection, both require the humanoid
Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if Humanoid.MoveDirection == Vector3.new() then return end --Think it still works if you compare the magnitude to 0
--Particle code
end)
--Or
Humanoid.Running:Connect(function(speed)
if speed == 0 then return end -- Not moving
--Particle code
end)
Or if you’re not planning on using these events, just check the MoveDirection when needed
6 Likes