1
\$\begingroup\$

I have an UParticleSystemComponent attached to ACharacter. Its activation is controlled by user input, so it receives several updates per second.

For replicating the activation state of the particle system, the user input triggers an update of the value of a replicated variable (UPROPERTY(Replicated)) on the ACharacter. This works fine for the direction

  • Listen server -> Clients,

however not for the directions

  • Client -> Listen Server
  • Client -> Client.

I assume this is the case b/c "Property updates only come from the server (i.e., the client will never send property updates to the server)".

So for Client -> Client replication I have to rely on RPCs and can't use property replication at all?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

In order to replicate properties, you need to replicate the actor holding the properties. In Client/Server, the server is simulating the behaviors of all the replicable actors, then sending updates out to clients. So you should use Broadcasts (Run on Server not Run On Owning Client or Multicast) to send input to the server, which then acts on receiving the broadcast.

\$\endgroup\$
2
  • \$\begingroup\$ So a mix of server RPC (Owning Client -> Server) and replicated properties (Server -> all clients). Remains the question, if it's cheaper for the second step to use an unreliable NetMulticast instead of replicated properties (three floats). \$\endgroup\$
    – Richard
    Mar 30, 2018 at 20:57
  • \$\begingroup\$ The server RPC + replicated prop method works better than server RPC + multicast RPC b/c for the replicated prop I can set COND_SkipOwner which I can't for RPC. So answer accepted. \$\endgroup\$
    – Richard
    Mar 31, 2018 at 10:27

You must log in to answer this question.

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