Hello, I would like to know some ways in which people synchronize client actions with the server.
For example: The Player can control a turret on the map with the WASD keys. How would you do this? Would you use remote events so that when the player presses some of these keys, the turret turns on the server side?
You could do that, but the action will be delayed since it takes time for the client input to travel to the server to process it. If you allow the client to control the turret, it will be less delayed, however it won’t replicate to the server, even if it does, that client is ahead of the server since it takes time for the server to receive the client’s changes to the turret and send it to other clients. Either way, there will be a delay. So based on my knowledge, sync client actions with the server are impossible. However, some designs like slower replication to minimize the differences might work.
i’m not too well versed in Roblox physics but I believe you can avoid the pain of trying to replicate the turret’s movement entirely by using physics objects like Hinges and force objects to rotate the turret.