How can I make a particle disabled when the player isnt moiving

I’m making a platformer and I want to make it so when the player is walking there particles behind them kind of like ego moose’s platformer movement

how can I make it so when the player isn’t moving the particle is disabled

heres the workspace for the particle
image

Ok, add a script that checks if the run state is enabled if not then disable them
Something like:

if runningState == true then
particles.Enabled = true
else 
particles.Enabled = false
1 Like
local __PLAYER = game:GetService("Players").LocalPlayer
local __HUMANOID = __PLAYER.Character:FindFirstChildOfClass("Humanoid")

__HUMANOID.Changed:Connect(function(Value)
	if Value == "MoveDirection" then
		if __HUMANOID.MoveDirection.Magnitude <= 0 then
			task.spawn(function()
				for _,v in script.Parent:GetChildren() do -- Change this to where the particles belong.
					if v:IsA("ParticleEmitter") then
						v.Enabled = false
					end
				end
			end)
		end
	end
end)

This effects only the client itself, if you want a server-sided one, you can reply.

1 Like
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
	if Humanoid.MoveDirection.Magnitude > 0 then
		 Character.FootL.AirPuffParticle.Enabled = true
         Character.FootR.AirPuffParticle.Enabled = true
    else
		 Character.FootL.AirPuffParticle.Enabled = false
         Character.FootR.AirPuffParticle.Enabled = false
	end
end)
1 Like

wow lol I left for 5 minutes and came back to like 3 replies thanks a lot ill try these

were would they go? in the particle emitter or in starter scripts I don’t know how to script at all so I don’t know were they go

StarterCharacterScript for my snippet. Are the particle emitters in the characters itself?

1 Like

StarterCharacterScript as a local script

1 Like

yes the particle emitters are in the characters feet

these both dont seem to work ill test them in another place

Which “Feet” exactly are you referring to?

FootR and FootL theres a screenshot in the post

any errors? or smh like that e

no errors

oka ywait

local __PLAYER = game:GetService("Players").LocalPlayer
local __HUMANOID = __PLAYER.Character:FindFirstChildOfClass("Humanoid")

__HUMANOID.Changed:Connect(function(Value)
	if Value == "MoveDirection" then
		if __HUMANOID.MoveDirection.Magnitude <= 0 then -- not walkign (opposite of walking, stops) stopping
			task.spawn(function()
				for _,v in script.Parent:GetDescendants() do
					if v:IsA("ParticleEmitter") then
						v.Enabled = false
					end
				end
			end)
		else -- WALKING ???? 
			task.spawn(function()
				for _,v in script.Parent:GetDescendants() do
					if v:IsA("ParticleEmitter") then
						v.Enabled = true
					end
				end
			end)
		end
	end
end)

add print and check if its being fired

1 Like

ok ill try this

Can you try mine? It loops through the entirety of character and disables them.
Edit: I just fixed something, you can repaste it.

1 Like

like this

local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
	if Humanoid.MoveDirection.Magnitude > 0 then
		Character.LeftFoot.AirPuffParticle.Enabled = true
	else
		Character.LeftFoot.AirPuffParticle.Enabled = false
		print("Disabled")
	end
end)

hmm its printing I decided to change it and try it on a deffault roblox rig instead of my custom character but then the character couldnt but the particle would only play when i press w which is good

add it to both to see if it even works

1 Like

Works! tysm for the help lol idk why it didnt work for the first time

also thanks @weakroblox35 for the help to