2nd player can't destroy actor

I am creating a very basic item pickup script for multiplayer but I honestly can’t get it too work and I don’t know where I am going wrong. Basically, when the player is in the trigger box of an item, they press the “Pick up item” key and it should destroy the actor.

This works perfectly fine on the server script however the client prints that he has picked up an item but no actor is destroyed.

Here is my basic blueprint here:

I know it is messy and some things might not make sense but I have been working on this for a while and trying everything I can to get it too work.

Thanks in advance for any help.

When I do this, it seems to work and still print the string but just doesn’t destroy the actor. Ill give your method a try.

Havnt done any multiplayer with client-server logic yet, but shouldnt you get the instigator, means ClientPlayerController which send the input message to PickUp and Destroy?

When i see that Get Player Controller Index 0, it looks to me that it only be caused by the first player registered.

Hey, do you have a setup which controls the receive input from instigating ClientPlayerController? Maybe it prints the string regardless which player controller fired this

Hey ReallyGoodPie,

Variable replication is one-way, from the server to the client - so the server is probably never receiving “On Rep Item Destroyed”. Also, note that generally the creation and destruction of replicated actors does need to happen on the server.

It looks like in this scenario a “Run on server” event is what you want. When the client calls it, it will be sent to the server, who can then destroy the actor in the event’s implementation.

Hey I would just like to show you my current setup. I have followed what Wallhala said in the comments and your method for running on server but I still can’t get it too work. Any help on this?

I have also removed the cast to player controller and attempted to gain access to controller via index the same way as the original post but it does the same thing.

I managed to complete it with the following BP script.Basically, in the item blueprint, we run a small script to get the character who is overlapping the trigger box using “Cast To Character” then we set some of it’s variables, one equal to being near an item and the other being the item that it is near (which is in the form of the item blueprint). We then set these variables to None when the overlap is ended.

After that, we run another small script in the player blueprint. We check if the player is attempting to pick up an item, if it is, we check that there is an item in range (which is set by the item blueprint). After which, we tell the server to destroy the item that it is near.

I was basically going about this the wrong way and handling the player interaction within the item blueprint rather than the character blueprint.