Remote event lag

  1. **The custom part trail is supposed to be right under my feet, with me spamming parts and using debris to get rid of them every 5 seconds

  2. **there spawning pretty far behind my robloxians feet when walking/running almost like its lagging

the local script spams the remote event, but its on a toggle you toggle it on and off by pressing a key.

https://gyazo.com/32b3b8d80ab35e31fef730164dd7bdb3

rs = game:GetService("ReplicatedStorage")
remotes = rs:WaitForChild("IceSlideRemote")
event = remotes:WaitForChild("IceSlide")
ice = remotes:WaitForChild("Ice")

event.OnServerEvent:connect(function(plyr,char,hr)
	local ice2 = ice:Clone()
	ice2.Parent = char
	ice2.CFrame = CFrame.new(hr.Position)*CFrame.new(0,-3,0)
	ice2.Anchored = true
	game:GetService("Debris"):AddItem(ice2,5)
	
end)

When firing to the server there will be a delay between the time it takes for the client to send information to the server. If you want it to appear smooth you could simply include an offset in your script so that it appears as if its in the same location. (However you would need to scale the offset to the players walk speed, E.G if they are Idle then you don’t want it to appear awkwardly in front of them) Imo though I would honestly handle visuals locally and then have it appear for all other clients since it’s not something that’s going to put another client off.

1 Like

oh yea thats right i can just have it appear to all clients

Also that worked amazingly. (…30chars)

1 Like