I want to make a dust effect so like a particle when I walk

Hello thank you for reading this.
First what I want to achieve:
I want to be able to scripta dust particle so like sand when I walk.
What solutions I tried:
I tried searching it up but could’nt find any information about it.
I would appreciate any tips thank you! :slight_smile:

6 Likes

You could create a new part which would be at (or around) the player’s feet when the player walks and then parent a particle emitter to that part. You could then subsequently destroy it after a given amount of time.

but how do i do that is their a function that say if the player is walking or something

All you need to do is clone a particle emitter into your characters legs. Create a folder in Rep. Storage and then simple make a script that when your player’s is added, connect a function that clones the particle emitter into your legs.

but how do i make the position of the particle emitter in the legs

Humanoid.Running:Connect(function()
   --Clone the particle, and parent it to the characters legs.
end)

so that’s all i need to do but just make the particle emitter and make the parent the legs

Precisely, however for these type of things you should go on the Developer Hub, and research HumanoidStates. They are really useful for movement.

and do i put this script in ServerScriptService

okay thank you I’ll tell if i need more help

A LocalScript, for the effects at least. Detect when the Humanoid goes into the Running state on the server, and use RemoteEvent:FireAllClients to replicate the effects to all players.

This should do the trick:

Name - WalkingParticles

Type - LocalScript

Description - Render footsteps on clients only rather than using the server’s resources.

Location - DataModel > StarterPlayer > StarterCharacterScripts

File - WalkingParticles.lua (1.9 KB)

Script - Source
-- Services --
local Players = game:FindService("Players")

-- Variables --
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local CharacterType = Humanoid.RigType
local R15 = Enum.HumanoidRigType.R15
local R6 = Enum.HumanoidRigType.R6

-- Functions --
local function CreateParticleEmitter(Parent: Instance)
	local NewEmitter = Instance.new("ParticleEmitter")
	NewEmitter.Transparency = NumberSequence.new(0.7, 0.9)
	NewEmitter.Texture = "rbxassetid://129985930"	
	NewEmitter.SpreadAngle = Vector2.new(10, 10)
	NewEmitter.Size = NumberSequence.new(0.3)
	NewEmitter.Lifetime = NumberRange.new(1)
	NewEmitter.EmissionDirection = "Back"
	NewEmitter.Enabled = false
	NewEmitter.Parent = Parent
	return NewEmitter
end

local function SetParticleEmitters()
	if CharacterType == R15 then
		local RightFoot = Character.RightFoot
		local LeftFoot = Character.LeftFoot
		local ParticleEmmiterRight = CreateParticleEmitter(RightFoot)
		local ParticleEmmiterLeft = CreateParticleEmitter(LeftFoot)
		return ParticleEmmiterLeft, ParticleEmmiterRight
	elseif CharacterType == R6 then
		local RightLeg = Character["Right Leg"]
		local LeftLeg = Character["Left Leg"]
		local ParticleEmmiterRight = CreateParticleEmitter(RightLeg)
		local ParticleEmmiterLeft = CreateParticleEmitter(LeftLeg)
		return ParticleEmmiterLeft, ParticleEmmiterRight
	end
end


-- Create Particle Emitters --
local ParticleLeft, ParticleRight = SetParticleEmitters()

-- Connect Events --
Humanoid.Running:Connect(function(RunSpeed)
	if RunSpeed >= 1 then
		ParticleRight.Enabled = true
		ParticleRight.Rate = (RunSpeed * 2.5)
		ParticleLeft.Enabled = true
		ParticleLeft.Rate = (RunSpeed * 2.5)
	elseif RunSpeed <= 1 then
		ParticleRight.Enabled = false
		ParticleLeft.Enabled = false
	end
end)

12 Likes

so do i just add this script in serverScriptService and thats it?

Add it in starter character scripts as a local script.

ok thank you so much ill tell u if i need any more help

But how can i make the particle look more like dust

create your custom image, upload it and set it as the particle

ok thank you appreciate it :slight_smile: ur nice