Hello, I’m creating a soccer game in my freetime (just for me idk im having fun) and I created a function that addes impulse (Shoots the ball). But the problem is that in multiplayer when I shoot from server side it moves on server and on client, but when I shoot it from client it doesnt even shoot, it just plays the sound of the shooting ball and prints text but doesnt actually add impulse to the ball.
sound in video isn’t synced but you will eventually get it what im talking about
Hey there @RinoSine! So generally the location of replicated things is determined by the server. The player adding an impulse on his side should never force it to change on the server as this could mean players could control everything in the game without limit. Try having the client request the server make that impulse on the ball.
This ^^^^^
Always have the server move/change replicated actors.
For a soccer game you can get away with the ball having overlap events that interact with just the servers proxy of the character.
e.g. On begin overlap (ball collision) → switch has authority (Auth) → checks (player speed, special inputs etc) → calc kick/block/deflection → Add Impulse etc
This will handle a lot of the general interaction. You could additionally add physical materials to the phys asset collisions. Check against those on overlap to determine where on the player the ball hit and apply the correct physics interaction.
chest block, head bunt, shoulder block/deflection etc etc etc.