Partial Synchronization Server and Client

Hey, I face a problem. When spawning enemy by multicast , I find there are some enemies which should not exist in client.

The BP_RandomSpawn

20s problem appeared


Try this. This should work well, only problem with mine is that I didnt code that it should only spawn on the ground. I think yours does that. So try replacing everything except the spawn location calculation
EDIT: Multicasts only works if it is run by server. Also don’t forget to check the replicated checkbox in the actor u want to spawn in, and you dont have to enable reliable checkbox in the custom events

1 Like

a) set your spawned actor to replicate
b) spawn the character only on the server
c) no need to multicast. The actors will replicate on their own from server to client.

Multicast should mostly be used to show FX and play sounds on other players pc. Things that are not critical for gameplay.

1 Like

you are right, i thought it needs multicast but it doesnt

1 Like

Thank you! Problem is done. By the way, when should I set event “reliable”, for example, if there are many enemy should be spawned, should I set “SpawnEnemy” event “reliable”?

Reliable events are guaranteed to fire. Do not overuse them though. If you set everything to reliable and you run out of network bandwidth then you might still get dropped events.

Prioritize your events and do not ever call RPC’s on tick, and you should be fine :wink:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.