I have calculate the force for each clients and I have added the force at location to the target.
Now ------- get the rotation and location of the actor ( the physics box) and make it happen on the owning client
You don’t need a Server Event for ‘AddForceHover’, that can just be a regular function that follows after the ‘Has Authority’ node. The Clients can’t call that function anyway, and the server already is the server, so you’re just adding unnecessary complexity there.
The issue with using replicated events to do stuff on the client is that they don’t get called every frame, and in a laggy environment (aka any network connection), your client will always be behind and the player will lose control. You’ll quickly flood the network with calls if you try to do this on tick.
So, a better way to achieve this would be to run the entire simulation both on the Server and on the Client, and rely on ‘Replicated Movement’ to update the Clients’ position. The problem with running the simulation server-side only is that the client will always be behind, and will always jitter (just because you send an event or a variable on tick doesn’t necessarily mean it will arrive, and you will almost certainly flood your bandwidth almost instantly.) This would do for a start or for a LAN-only game, but you will start having problems as soon as lag is introduced again
Hi, great content on your youtube page. I understand from your cube video, all physics is happening on server, and even client cant keep up.
“So, a better way to achieve this would be to run the entire simulation both on the Server and on the Client, and rely on ‘Replicated Movement’ to update the Clients’ position.”
So I shouldn’t disabled the physics on the server. I add force to the client, and then send its location and rotation to the server? And then the server multi casts it right?
update- character class supports movement prediction at the moment
If I use physics based controls on a character class ,and change mesh to a space ship, then this should work better on multplayer right (I’ll have to override the mesh capsule to a box collider I’m guessing).