When I aim down sight the first time, it works fine

Then I switch weapons, my secondary works fine too

Then when I switch back, the AK-47 ads is broken

Weapon Swap script using UnityEngine;using System.Collections;public class weaponSwitching : - Pastebin.com
Aim Down Sight script using UnityEngine;using System.Collections;public class pistolADS : MonoBe - Pastebin.com
If you need anymore information, or screenshots, just tell me. I have no idea what is causing this. But it’s really annoying.
If you just keep aiming down sights with just the ak, not switching weapons, does it work every time?
Yes. If I have not yet switched weapons, I can ADS as much as I want and it works fine.
Does only the sniper gameobject have the ads script on it? Because I see you are only calling that in your weapon switch script.
EDIT: Or rather Weapon2 gameobject?
Both weapons have the same ads script on them.
Okay, I don’t know what causes it, but I found a fix for it. Put both weapons as a child of an empty game object, put the weapon swap script on the parent empty game object, have both weapons enabled by default and the parent empty disabled and enable it in the start function in a script. I don’t know how that fixes it, but it does for me.