What I would do would be relatively simple:
- Insert a BasePart using instance.new from either the Client or Server. If it is created by the Client, it won’t be seen by other players. If it is created by the Server, other players would see your dust particles.
- Use a RunService loop to keep this part at the desired position. I recommend a position around here for your BasePart: HumanoidRootPart.CFrame - Vector3.new(0,2,0).
- Create a Particle Emitter within the BasePart using Instance.new. Adjust the particle emitter to your liking.
- Now that you have your particles working, you will have to make sure that the particles only enable when the player is moving. Here is some code I found in EgoMoose’s Character Controller which returns if the player is moving or not:
function Module:isMoving()
local moveSq = ClientHumanoid.MoveDirection:Dot(ClientHumanoid.MoveDirection);
return moveSq > 0 and ClientHumanoidRootPart.Velocity.magnitude > 4;
end
- In a RunService loop, check if the player is moving. If the player is moving, enable the particle emitter:
if Module:isMoving() then
ParticleEmitter.Enabled = true;
else
ParticleEmitter.Enabled = false;
end
- (Optional) If you want to disable the dust particle while in the air, just add this to the code above:
if ClientHumanoid.FloorMaterial == Enum.Material.Air then
ParticleEmitter.Enabled = false;
else
if Module:isMoving() then
ParticleEmitter.Enabled = true;
else
ParticleEmitter.Enabled = false;
end
end
Hope this helps!