Adding weapons to a networking game

So, I have tried to add weapons to my multi-player networking game. The problem is the only place they are working is the host. The outline of my code is just to pick up the weapon and that is working fine the problem now is when I pick up the object on a client it turns around weirdly instead of just staying straight, which is what I want to happen. When I pick the weapon up on a client the host doesn’t even register it. So, what am I dong wrong, is it my coding or what.

That’s a ton of code to weed through. But, from what I saw I don’t see any functionality for the client to actually tell the server about weapon equips. When your player does an action like equip a weapon, then it must tell the server to do that action and the server must in turn tell the other clients… something like this…

 void playerEquips()
    {
           //I am the local player and have chosen to equip my weapon
           CmdPlayerEquip();
    }
    
    [Command]
    void CmdPlayerEquip()
    {
          //I am the server, a player has told me they'd like to equip a certain
          //object... I will do stuff to make sure this is legal, if so, I'll do it
          //if I did that stuff then I will tell the other players to show this as well
    
           RpcPlayerEquip();
    }

[ClientRpc]
    void RpcPlayerEquip()
    {
          //some player on the network has equipped a weapon, I will show this
           //on my end
           //change objects, display new objects etc...
           //I will also be called on the player that initially started the equipping
           //process
    }

That’s a tad overwhelming.

I’ve just finished building an online top-down shooter with Photon.

Here’s some important things I wish I understood going into it.

1.) I see you’re checking to see if the player IsLocal quite a lot. This is great. However, it’s easy to lose track of what you’re actually wanting to check for. Are you wanting to check to see if the player !IsLocal or if the player is a client connected to the host? They’re not interchangeable and being watchful of this will save you lots of debugging time.

2.) Generally, when you do something to LocalPlayer, you need to do the same thing to that player over the network for other players to see. In photon we use Remote Procedure Calls(RPC) to accomplish this. If player A changes their color from blue to red on client side. We now need to send a command FROM this local player over the network to each other player and change the color of the “target” player (which is Player A). Wrapping your brain around that general idea was super helpful for me.