Spawn actor locally


I am placing actors in the world at runtime from user input and I have also added a ghost like preview to show you where the actor will be placed in the world, works in multiplayer with one issue, the servers ghost is visible to the client.

The way I am showing the ghost is: -

  • Spawn actor that isn’t replicated and is empty
  • Inside that actor spawn another actor, this actor is the actor that is replicated and the one that would actually be placed in the world
  • attach that actor to the empty actor

This works perfectly on clients just not on server

(I could make a new actor for each preview but that would be a lot of duplicate code)

So the question is how can I spawn a actor on the server that is marked for replication but spawn it on the ServerClient as if the client spawned it locally