AddComponent deletes the game object.

This should work right?

void Awake()
	{
		if(Type == WeaponType.Projectile)
		{
			gameObject.AddComponent<BallisticProjectile>();
		}
	}

Instead it deletes the weapon. What am I doing wrong?

The issue resides either in “BallisticProjectile” script or in other parts of the code not posted here.