Footprint trail is still enabled when foot is lifted

Hey everyone! I’ve been looking for a basic and low performance way to make footprints since it’s gonna be used in a snowy map i’m making. It works fine but whenever I jump mid walking the trail still follows my feet going higher. I tried fixing in my script but it still doesn’t work:

local players = game:GetService("Players");
local run = game:GetService("RunService");
local character = script.Parent


local humanoid = character:WaitForChild("Humanoid");
local LowerTorso = character:WaitForChild("LowerTorso")
local Trail = LowerTorso.FootTrail

local function disableAllParticles()
	for _, particle in pairs(LowerTorso:GetChildren()) do
		if particle:IsA("Trail") then
			particle.Enabled = false;
		end
	end
end

run.Stepped:Connect(function(delta)
	if humanoid.MoveDirection.Magnitude > 0 then

		if humanoid.FloorMaterial == Enum.Material.Snow then
			Trail.Enabled = true
		else
			Trail.Enabled =  false
		end

	else
		disableAllParticles();
	end
end)
if humanoid.Jump == true then
	Trail.Enabled = false
else
	Trail.Enabled =  true
end

Your humanoid.Jumped if statement should go into the run.Stepped:Connect(function(delta) function, like this:

run.Stepped:Connect(function(delta)
	if humanoid.MoveDirection.Magnitude > 0 then

		if humanoid.FloorMaterial == Enum.Material.Snow then
			leftSnowParticle.Enabled, rightSnowParticle.Enabled = true, true
		else
			leftSnowParticle.Enabled, rightSnowParticle.Enabled = false, false
		end

	else
		disableAllParticles();
	end

	if humanoid.Jump == true then
		leftSnowParticle.Enabled, rightSnowParticle.Enabled = false, false	
	else
		leftSnowParticle.Enabled, rightSnowParticle.Enabled = true, true
	end
end)

This way, the if statement will run every frame, and not just once.

I tried it and it sadly doesn’t work still

And it also actually doesn’t stop when the material changes or when in i jump even if i wasn’t running