Lag when joining server late

  1. What do you want to achieve?
    I am making a plane game and want to make the game run smoother.

  2. What is the issue?
    When there is a fresh server it works OK.
    But when you join an older server the game works with a delay (not all game only plane control)

I am using remote events to get mouse position to server and body gyro, body velocity for plane to fly.
But the interesting part is that for the players that have been in server from beggining the game doesn’t lag.

[Sorry for bad English]

3 Likes

Are you having the client tell the server your mouse position every RenderStep, Step, Heartbeat, second, etc? Or, when your mouse moves? This and the efficiency of how your server handles the remote data, could impact your preformance.

older the server gets more laggy its gonna become thats just how roblox is

but about your plane scripts:

  1. you shouldnt be telling the server where your mouse is then updating the plane from there. allow the client to take control once they sit in. this will heavily reduce your lag

  2. if you got any animtions on the plane (like movement of flaps, etc) keep it on the client there is no need to replicate that and cause more lag

  3. the spamming of your remote event to the server causes the server to slow down since all of the network being received

  4. if the server handles every plane in the air all the time the server is going to crash, so refer to #1

if you’re using a remote event to send the mouse position from the driver couldn’t you remove the remote and just give the driver network ownership

mouse.Changed:Connect(function()
	script.Parent.setpos:FireServer(mouse.Hit.Position)
	
end)

Can you explain? How do i do that? Can you give me an example?

You can set network ownership of unanchored parts to players in the game, this will allow them to move the part on their client and it will replicate to the server, this is usually used when making vehicle.

After setting network ownership using a server script you’ll just have to change the properties of the physics on the client and the parts will move on the server.
A way to easily get the player to set network ownership to is to use Seat:GetPropertyChangedSignal("Occupant"):Connect(function() then check if someone is sitting in the seat or not. If someone is sitting get their player and set network ownership

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