1
\$\begingroup\$

I'm attempting to add multiplayer support to a new first person game we're working on in Unreal 5.

Starting with the FPS template, it seems like the player and the gun both behave as expected across instances (after some tweaks), but the dynamic cubes in the environment don't match when moved around.

unreal cubes mismatched in different views

The cubes are StaticMeshActors, and they all have replication enabled (the checkbox for "net load on client"). Is there something else we're missing?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Non-decoration physical object interactions need to only exist on the server.

Uncheck the Simulate Physics box in the editor.

To make the change replicate, you need to create a blueprint applied to the the base object that has the condition of HasAuthority, and then call the Enable Physics node. Be sure to enable replication on the object.

Yes, it is possible to replicate the position to peers without "Authority", but this could lead to discrepancies in gameplay. since each clients physics resolver adds forces based upon position, the results would not be consistent.(since physics is enabled on all clients/servers)

\$\endgroup\$
2
  • \$\begingroup\$ I'm not seeing any reference to "IsAuthority" in UE5. Can you ben more specific about what you mean? \$\endgroup\$ Commented Feb 21, 2023 at 2:25
  • \$\begingroup\$ The "Has Authority" node is the node to see if the if the code is running on the server or client. UE5 may have renamed the node, but it is there somewhere. \$\endgroup\$
    – user122973
    Commented Feb 23, 2023 at 3:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .