Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

alt text 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.

Product Version: UE 4.20
captura.png (177.0 kB)
more ▼

asked Jul 23 '18 at 02:49 AM in Blueprint Scripting

avatar image

16 3 6

avatar image mightyenigma Jul 23 '18 at 04:07 AM

which part is not working? All of it, the add to inventory, or the destroy?

avatar image facundo_villa Jul 23 '18 at 04:26 AM

Hey, no the problem is the destroying part, everything else is working fine. I can't get around destroying it, not even on the owning player. It did work correctly on the standalone version though.

avatar image mightyenigma Jul 23 '18 at 06:36 AM

I can only think it is not reaching the destroyself RPC. Are there any warnings or errors in your output logs that would indicate it skipped executing past there due to some nonfatal error?

avatar image facundo_villa Jul 23 '18 at 07:53 AM

No, there aren't any errors in the log. I tried destroying destroying another instance of the actor created during gameplay from the Character BP (and destroyed from the Character BP) and it worked just fine. I don't know why this isn't working.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Jul 23 '18 at 08:14 AM

avatar image

16 3 6

avatar image mightyenigma Aug 08 '18 at 11:24 PM

Ah yep. Sorry I didn't notice that. I have run into that problem before many times. When it happens, I just create an RPC event in the playercontroller class to handle it and pass params to reference or find whatever I need to operate on.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question