Attach component to component multiplayer issue

Hi everyone, trying to make my first multiplayer game. My issue is a server/client issue that i’ve been working on for hours. I have attached my blueprints.

What’s supposed to happen is: in the multiplayer game 1 player is allowed to grab the ball at a time. I want whatever player that grabs the ball to be replicated to other players. I have tried running all the blueprint code on a server and multicasting at the same time but i cannot get it to work.

Along with this I have a more general questions. Where should all of these actions take place? Line trace for each player (on the server?) Attach Component To Component on the server as well? When do we update client’s views?

Thank you very much for the help!



If you want to broadcast the player’s information to other clients, you can only RPC Server first, and then the server multicasting to all clients.
When the player wants to grab the ball, he should notify the server to request the player to grab the ball, and then the server will send it to the client after verification, the client now implement the logic of grabing the ball.

I tried putting a server call at the very beginning as soon as the player presses ‘E’. Then calling a multicast right after that did not work.

I don’t understand what you mean. The result with this setup is the same, all good on Server player but not on client.

I ended up changing my BP_PickupObject. I had BP_PickupObject(Self) then a Root Scene Component and then under that I had a Ball Static Mesh Component. I dragged the ball static mesh onto the root scene component to get rid of the root scene component. Now i just have (Self) and Ball. It replicates now but is glitchy.

Also changed it to Attach Actor To Component instead of Attach Component to Component.