3D Walking/Running Particles don't stop even when the Player isn't moving

The title says it all. But the Tween also doesn’t resize the part.

Here’s my code.

--//Variables//--
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Root = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")
local LeftFoot = Character:WaitForChild("LeftFoot")
local RightFoot = Character:WaitForChild("RightFoot")
local Footstep = Root:WaitForChild("SteppingSound", 30)
----------------------------------------------------
--//Function//--
function onHumanoidRunning(Speed)
	if Speed > 6 then
		Footstep.Playing = true
		local DustPart1 = Instance.new("Part", LeftFoot)
		DustPart1.Name = "DP1"
		DustPart1.Size = Vector3.new(.75, .5, .75)
		DustPart1.Position = LeftFoot.Position
		DustPart1.BrickColor = BrickColor.new(255, 255, 255)
		DustPart1.Anchored = true
		----------------------------------------------------
		local DustPart2 = Instance.new("Part", RightFoot)
		DustPart1.Name = "DP2"
		DustPart2.Size = Vector3.new(.75, .5, .75)
		DustPart2.Position = RightFoot.Position
		DustPart2.BrickColor = BrickColor.new(255, 255, 255)
		DustPart2.Anchored = true
		----------------------------------------------------
		local TweenInform = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
		local TweenSize1 = TweenService:Create(DustPart1, TweenInform, {Size = Vector3.new(1.25, .75, 1.25), Transparency = 1})
		local TweenSize2 = TweenService:Create(DustPart2, TweenInform, {Size = Vector3.new(1.25, .75, 1.25), Transparency = 1})
		TweenSize1:Play()
		TweenSize2:Play()
		task.wait(0.5)
		DustPart1:Destroy()
		DustPart2:Destroy()
	else
		Footstep.Playing = false
		local DustPart1 = LeftFoot:WaitForChild("DP1")
		local DustPart2 = LeftFoot:WaitForChild("DP2")
		DustPart1:Destroy()
		DustPart2:Destroy()
	end
end
function onHumanoidNotRunning()
	Footstep.Playing = false
end
--//Connections//--
Humanoid.Running:Connect(onHumanoidRunning)
Humanoid.Jumping:Connect(onHumanoidNotRunning)
Humanoid.FreeFalling:Connect(onHumanoidNotRunning)
Humanoid.Swimming:Connect(onHumanoidNotRunning)

Uhhh… Maybe you should also make it so that the DustParts also get destroyed when the “onHumanoidNotRunning()” function plays?

Oh yeah forgot about that thanks :slight_smile: but how do i make there be more dust clouds that appear?

I mean, you could just add another DustPart instance that appears somewhere else near the player’s legs or something.

Why not place a Particle emitter at an Attachment you place slightly under the ground’s surface?
The effect’s size can be a numbersequence that you can ‘animate’ to make it size properly which would allow you to make it appear to puff up and then settle back down.

Because if you’re playing with low graphics level then you won’t be able to see the particle that much and i don’t like that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.