I created an UDP server which recieves a position of a player in a game. The player sends their coordinates to the server continiously. The server sends this data to all the clients that are in the game so they can see eachother move. It’s kinda working but sometimes there comes a delay (this doesn’t happen all the time tho). So it’s like the other players are moveing in slow motion. Is there anything that I can do to get rid of this delay?
So the game detects when the player presses the w, a, s or d key (which makes the player move) when it detects this it applies the movement to the player.
another function gets the worldposition (coordinates of the player) and sends it to the server.
all the functions on the client side are being run seperately.
The whole project:
I know it’s a big chunk of code but I am really lost here and don’t really know what might be causing this.