Replicate Spawn/Destroy actor

Hey, I seem to have a problem with spawning and destroying actors. I have my Character BP that calls Interface functions that send messages to a Actor BP, telling it to either spawn or destroy. I placed a few of test actors into level. My Server can both destroy (already placed actors) and spawn (actors of that class) actors. Those can both be seen by client. But Client can not destroy actors that are already placed in level. Client can spawn actors of that class and then destroy actors that he spawned, but those actors are not seen by server. Does anybody know what is going on? I am Running version 4.5.1.

It sounds like you aren’t replicating actions taken by Client. Can you show me some screenshots of all relevant Blueprints? Particularly details on Events you’re using to spawn and destroy actor? Thanks!

Spawn Mechanism:

Interface functions have nothing special about them.

Destroy Mechanism:

Properties of object that is spawned/destroyed:

Hey UDKAP,

Thanks for images. My first thought is that BP_Inventory Widget is getting Player Controller at Player Index 0, which will return same value for each player using Widget. I also can’t see your replication settings on your events.

It’s going to be difficult to determine what is causing problem here without seeing it in action. If you’re comfortable uploading your project, or a test project with same issue, somewhere I can access it online, I’d be happy to take a closer look.

Otherwise, you can place breaks in your Blueprints and click through process node-by-node to see where it is stopping while running on a client. If you can narrow down area that is not replicating way you’d expect, we can see what is causing issue.

Hello,
Thank you for your help. These functions are called over a BP Interface, I don’t know if Interfaces or Interface functions have a Replication check box, if they do can you tell me where to find it. Also, because server is able to interact with these objects perfectly, and after all server is one who should control spawning and destroying in multiplayer games, is there a way to let client tell server to spawn these actors?

``Edit:
I placed custom events set to “Run on Server” to make my server control destroying, now, both server and client can destroy these actors in a safe way. I am still working on spawning, it seems that if server spawns and actor client can’t see it and if client spawns it server can’t see it.

That was what I was going to suggest =) Having a custom event run on server that then calls function in BP Interface lets everything run on server and replicate to clients.

Have you done same thing for your spawning functions? If so, are you spawning parent class or creating a new BP as a child and spawning that?

I am using a Child of class, i tried this setup for child class and it doesn’t work, but it works for Blueprints from starter Content. So has it something to do with fact that I am dealing with child classes?

Did you make sure child is set to replicate?

For some reason Child Classes all had “Only relevant to owner” checked. Thanks a lot for your support, you were a real help. :slight_smile: