Destroying actors in Multiplayer
Hi everyone. Im just getting into networking/replication in UE. Right now what i am trying to do is to have my character pickup an object from the world which is already there on the map.
I have an interface event which fires from the Character BP and tells the pickup it is being picked up, which then fires a Character's event telling it to add the pickup to it's inventory and passing through the properties, after that i want my pickup actor to be destoyed so that nobody can later pick it up as well.
The image you are seeing is the script for the pickup (Base Pickup Weapon).
My Base Weapon Pickup class (the one that has to be destroyed) is set to replicate already. I've been trying out some things with no luck, so any help would be appreciated.
asked Jul 23 '18 at 02:49 AM in Blueprint Scripting
After searching through internet i found the problem. Replicated events can not be fired from actors who do not have a Net Owner, that means that they are possesed (owned by a player controller) or are a player controller. My pickups do not have a NetOwner so they couldn't ask the server to destroy them.
So what i had to do is have the pickup ask the Character to destroy them (by a replicated event on the Character) after they've completed their function.
Follow this question
Once you sign in you will be able to subscribe for any updates here