My WeaponSwitch Doesn t work properly

This is my Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class weaponScript : MonoBehaviour
{
int totalWeapons = 1;
public int currentWeaponIndex;

public GameObject[] guns;
public GameObject weaponHolder;
public GameObject currentGun;

// Start is called before the first frame update
void Start()
{
    totalWeapons = weaponHolder.transform.childCount;
    guns = new GameObject[totalWeapons];

    for (int i = 0; i < totalWeapons; i++)
    {
        guns *= weaponHolder.transform.GetChild(i).gameObject;*

guns*.SetActive(false);*
}
guns[0].SetActive(true);
currentGun = guns[0];
currentWeaponIndex = 0;
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.E))
{
//next Weapon
if(currentWeaponIndex < totalWeapons-1)
{
guns[currentWeaponIndex].SetActive(false);
currentWeaponIndex += 1;
guns[currentWeaponIndex].SetActive(true);
currentGun = guns[currentWeaponIndex];
}
}
if (Input.GetKeyDown(KeyCode.Q))
{
//previous Weapon
if (currentWeaponIndex > 0)
{
guns[currentWeaponIndex].SetActive(false);
currentWeaponIndex -= 1;
guns[currentWeaponIndex].SetActive(true);
currentGun = guns[currentWeaponIndex];
}
}
}
}
When i move the camera then switch weapons the other weapon are not moved

Maybe your weapons gameobjects aren’t attached to your camera?