Custom Spawn Function

Player Controller

if(identity.isOwned){
// Set Instance too equal this player
// Will allow for script to gain access to the correct player for the client
}

Inventory Manager

 [Command]
 public void CmdDropItems(int amount, ItemData item)
 {
     for (int i = 0; i < amount; i++)
     {
         GameObject itemDrop = Instantiate(ItemDropPrefab, Camera.main.ScreenToWorldPoint(Input.mousePosition), Quaternion.identity);
         NetworkServer.Spawn(itemDrop);
         itemDrop.GetComponent<ItemDrop>().item = item;
     }
  }

Key Changes:

  1. Network Commands and RPCs:
  2. Network Instantiation:
  3. Local Player Checks:

These changes ensure that inventory actions are synchronized across all clients in a multiplayer environment.