Replication for moving actor

I have a dedicated server with two clients.

If one character has an impact with some actor, this actor is bouncing from the character to a new place.
However, another client observes another new location of the object.
It looks like each client calculates the bounce itself.

I want to have all the movements of an actor on the server with exact representation for all clients.
I played with replication setpoints, but it gives nothing.

Please help with setting for replication. Maybe something else is wrong.

If you are using the Static Mesh Actor as you physics objects parent class, you can set the “replicate movement” flag on for that actor. This should do all replication automatically.

Yes, It should, but not.
It does not matter a dedicated server or not. Even if I use Server and Client, bouncing is different. My StaticMesh is in different locations for server and client after the bouncing.

Please see the picture with settings.

The same issue here

I’ve tried to switch off physics and collision for clients only, however, an actual location of the actor is not passing to the clients.

I still cannot fix an issue.
I’ve created the standard scene for the third person and activated replication for static meshes (cubes) and projectiles (balls) as per stream from Epic. It works as was shown. However, standard Actor with StaticMeshComponent doesn’t want to be replicated as regular StaticMesh.

  1. If I use StaticMesh on the scene, everything is good. It replicates absolutely correctly.
  2. If I use StaticMesh as Component for an Actor, it doesn’t work.

I’ve tried all combination for settings of replication for the Actor.
I’ve tried switch-on replication for the root component and StaticMashComponent one by one and both together as well.
I’ve tried to switch-off physics for Client only.
It looks like something doesn’t work properly. Maybe it’s me.

Could you advise, how to use replication of movement for Actors with StaticMeshComponents?

I have found an interesting thing.
If StaticMeshComponent has a physics it can be moved, however, root component and Actor don’t move. It means, if I bump the StaticMesh to another end of the world, physically Actor remains on the same place, where it was created.

I created two replicated variables for location and rotation and updated them if StaticMeshComponent changes the location, Every tick I changed a position of the Actor to be on the same place with the StaticMeshComponent. On the client, I’ve changed the position of StaticMeshComponent as well. This solution works, however, all movements on the client are not smooth enough.

I didn’t find a description for the option “replicate movement”. There is no visible effect from that option in my tests.

1 Like

“replicate movement” works just for a root component.
For this feature, StaticMeshComponent must be chosen as “root”.

If not, it is just changing location in reference to root component.

1 Like

Thanks