Why is it that when the Player's Character touches the ground, it gives delayed signals to clients? Please help

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to emit a Particle when the player lands/hits the ground. Additionally, I want the particles to also be positioned in between the player’s “RightFoot” and “LeftFoot” .

  2. What is the issue? Include screenshots / videos if possible!
    The problem is that for some reason the particles are positioned differently on each client.
    Here is a visual representation of what the issue is, on the Right you have Client #1, and on the Left you have Client #2; where the main issue occurs:
    https://gyazo.com/a68adb9802ca01fd0c3c78689601facb

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

    I can’t wrap my head around it. I believe that this issue occurs because each client run at a different speed. I tried putting a “wait()” so that the script waits till the player hits the ground. Still no results. I also tried using a RemoteEvent!, all kinds of RemoteEvents that I think would work. From Client → Server, Client → Server → Client, and still no results. If you looked closely you’ll see that I used an attachment to position the particles. I also tried of using another method of just sending over to the server the position of where the player’s foot is located when he touched the ground and tried creating a part and position it where that interaction happened, and it still didn’t work. I also tried using “:Lerp” and let me just add I’ve never used lerp till now, but I’m pretty sure I used it right and it still gave me the same results. I also tried using lua Humanoid.Jumping Event and still no results.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Here’s the Client firing to Server:

Humanoid.StateChanged:connect(function(OldState, NewState)
	if OldState == Enum.HumanoidStateType.Freefall and NewState == Enum.HumanoidStateType.Landed then
		FootStepsEvent:FireServer(nil, nil, nil, true)
	end
end)

Here is Server firing back to all Clients:

    Event.OnServerEvent:Connect(function(Player, Foot, Material, Running, Jumping)

    	if Jumping == true then
    		Event:FireAllClients(Player)
    	end
    end)

And here is the Client receiving the confirmation again to do it’s job:

FootStepsEvent.OnClientEvent:Connect(function(x)
	repeat wait() until x.Character.Humanoid.FloorMaterial ~= Enum.Material.Air --[[ Here it waits for the player to land]]--
	local x = x.Character
	print("Player Landed")
	local Particles = {}
	Particles.Jump = ReplicatedStorage.Particles["Cloud Particles"].JumpParticle:Clone()
	Particles.FootSteps = ReplicatedStorage.Particles["Cloud Particles"].FootStep:Clone()
	
	local Cloud = Particles.Jump:Clone()
	Cloud.Parent = x.HumanoidRootPart
	Cloud.Position = Vector3.new(0,-2.6, 0)
	Cloud.CloudParticle1:Emit(13)
	Cloud.CloudParticle2:Emit(6.5)
	Trash:AddItem(Cloud, 2)
	
end)

If I posted something incorrectly, then I apologize. This is my third post since I have joined this forum. If you feel I have done something inappropriate or wrong, Let me know. Thank you in advance for your support!

  • Davie

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

This is happening because when the player hits the ground, it fires the event for the all the other clients, but due to input lag, the players character might not have hit the ground on all the other clients yet, thus creating the particles in the air. I can’t really think of any solution though.

Aww bummer! i knew it was in input lagg. It’s that much of a tricky problem huh? Thanks for the info tho, very useful.

EDIT:Aww bummer! i knew it was something related to lagg/delay. It’s that much of a tricky problem huh? Thanks for the info tho, very useful.

One thing you can try that might help - since you noted you use a wait() - is to write a custom wait function instead of using the default one, since the default Lua wait has some issues as documented in this thread. There are a few different custom waits in that same thread. That might alleviate some of your issues, but input lag is a tricky thing in general to deal with.

1 Like

Thank you for that response! I will look into that post because it does look interesting. I will let you know if it helps with my issue.