Is it possible to spawn in an actor that only exists on the client side?

Two choices:

  • Only spawn them on the client, and have the client let the server know they picked them up. This works if your server is a dedicated server, as listen server hosts (players that host a server), will have the actor replicate to other clients.
  • Possibly the better option, spawn the coin on the server, and override AActor::IsNetRelevantFor() to only make it relevant to said player. You can do this by checking that the RealViewer, which is generally the player controller, is the one of the player that should pick them up. This will ensure that only one player will see the coins.

The second option assumes you use C++, I don’t think Blueprints have access to that.

3 Likes