void RpcUpdateClients(int weaponSlot) { // Get reference to weapon script //var weaponShootingScript = GetComponent<WeaponShooting>(); // Hide current weapon if (weaponShootingScript.equippedWeapon) { weaponShootingScript.equippedWeapon.SetActive(false); //weaponShootingScript.equippedWeapon = null; } // Show new weapon weaponShootingScript.equippedWeapon = weaponSlots[weaponSlot]; weaponShootingScript.equippedWeapon.SetActive(true); weaponShootingScript.shootInit(); }