hey @L1z4rD89 Thanks a lot for your simple and clear example!
In this example is very clear how to move the cubes on both cases
client and server in sync.
My project is a bit more complicated because I want to move player by applying physics (by adding force and torque).
I achieved a good sync by adding the control forces from the server ( all players
will replicate what server moves) but in server side things jitter ( its understandable).
for tackiling that last issue, I duplicated the visuals (meshes) and I just show actual visuals
on the server player (because there is not jitter) and in the clients I am showing the duplicated meshes that dont have physics because are just visuals and update transforms with Interp. Works like a charm.
The final step to make it all work is transfer input controls from the clients to the server
so server can manage the forces for all of them but I am having HUGE problems
trying to figure out hot to transfer a simple Vector2D variable from each player to the
server so Server can appy the forces to move.
This is what I am trying right now and is not working:
my actor has an enhanced input and tries to send the Vector2D movement of the left thumbstick to the server. The player sends its playerID and thumb Value
Players have an instance of Gamestate stored in gamestate variable so I dont have to cast it every time…inside the game instance I have an Array with players data. Its a truct that only holds the Vector 2D for now like this:
As I have 10 players, I already created 10 items in the gamestate ‘player data’ array and each player registers there when game begins so this array has the ten players and matches ID with array index.
so this is on beginplay of the Actors:
now I just want the read the values of all imputs in gamestate:
I only receive a value when I move the SERVER side Actor.
When I move a client joystick there is not data displayed in gamestat
Any suggestions?
I dont want to mark this as solved even you solved a lot of clarity with your example but I am afraid if I mark as solved I wont get more replies