Problem with quaternion weapon sway

Hello, I’m trying to make a script where the weapon the player is holding sway when you move around but I’m getting an error The type ‘UnityEngine.Quaternion’ does not have a visible contructor(BCE0024), this is the code
public var defaultPosition : Quaternion;

var swayAmount : float = 5.0;

var swayX;

var swayY;

var swaySpeed : float = 5.0;

var newPos : Quaternion;

var gun : GameObject;


function Start () {

    defaultPosition = transform.localRotation;



function Update () {

    swayX = Input.GetAxis("Mouse X") * Time.deltaTime * swayAmount;

    swayY = Input.GetAxis("Mouse Y") * Time.deltaTime * swayAmount;

    newPos = new Quaternion(defaultPosition.x - swayX, defaultPosition.y - swayY, defaultPosition.z);

    gun.transform.localRotation = Quaternion.Lerp(gun.defaultPosition, newPos, swaySpeed * Time.deltaTime)

Thanks for the help.

that is usually because you need to use Quaternion.Euler as i don’t think you can instantiate a Quaternion directly