Multiplayer game - client is unable to destroy actor
So my game has a listen server. This can be either client when I run it with 2 players as it is managed by a menu that allows someone to host and someone to join. It has items that are able to be picked up- it works by having a single actor for all items with an index that changes what specific item it is, and if a player picks it up, it stores it on their user interface
(off screen is just a range check between either player and the object itsself- not super relevant as it works for sure on both clients) My problem is that when I start the game, and let someone join the other's game, the host can pick up an item and it adds it to their display port as normal and then the actor is destroyed from both clients as it should be, but if the client (NON HOSTING CLIENT) picks it up, the item widget is added to the inventory display port, but the actor is not destroyed. I did the networking tutorial and therefore I know to select the "replicates" property and have done that, however I am not sure why the client cannot initiate the script with it destroying the actor as the above screenshot is present on the item actor itsself. When the server picks up the item, it is destroyed on both the server and client. When the client picks up the item, it is destroyed on neither but the rest of the code in the first screenshot appears to work (IE it adds the item widget to the inventory box)
The second screenshot is the add item function. I'm quite new to UE4 (i've literally started learning it maybe a few months ago so maybe it is something obvious that I have missed). I can provide further screenshots if you want to see other related parts of my project.
asked Oct 10 '17 at 02:19 PM in Blueprint Scripting
Follow this question
Once you sign in you will be able to subscribe for any updates here