Download

Phsyics hover is not working replication

Untitled-1.fw.png

Server only handles physics

If you are the server then add force


I am reliable, and I will simulate this physics hover on the server


I am doing this on the server since I have authority, loop through points and point a ray down


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 have the location and rotation of the actor on the server right, well now do this on the owning client.

I can move using physics, but I cant move up using physics.

Please, someone, anyone, guide me…

A few things before I comment:

  • 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

I have explained this issue in a much bigger thread here: Lack of Movement Components for Networking - Feedback for Unreal Engine team - Unreal Engine Forums Brace yourself, it’s a bit of reading!

Long story short, your game just got a lot more complicated :stuck_out_tongue:

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).