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?
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 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.