Gun Rotation

This script do that when I move the mouse X the gun rotates but i have an error:

Assets/GunMoveMentewfweaf.js(18,33): BCE0024: The type 'UnityEngine.Quaternion' does not have a visible constructor that matches the argument list '(float, float, float)'.

The Script:

public var RotateAmount : float = 1;
	public var RotateSpeed : float = 2; 
	public var GUN: GameObject; 
	public var RotateOnX : float; 
	public var RotateOnY : float; 
	public var DefaultRot : Quaternion; 
	public var NewGunRot : Quaternion; 

	function Start()
	{
		DefaultRot = transform.localRotation;
	}

	function Update ()
	{
		RotateOnX = Input.GetAxis( "Mouse X" ) *Time.deltaTime * RotateAmount; 
		RotateOnY = Input.GetAxis( "Mouse Y" ) *Time.deltaTime * RotateAmount; 
		NewGunRot = new Quaternion ( DefaultRot.x+ RotateOnX, DefaultRot.y+ RotateOnY, DefaultRot.z); 
		GUN.transform.localRotation = Quaternion.Lerp(GUN.transform.localRotation, NewGunRot , RotateSpeed * Time.deltaTime);
	}

Quaternions are 4D and the constructor takes 4 parameters, and these parameters are not euler angles. To do what you want here use Quaternion.Euler:

 NewGunRot = Quaternion.Euler( DefaultRot.x+ RotateOnX, DefaultRot.y+ RotateOnY, DefaultRot.z); 

A Quaternion takes 4 arguments. You are trying to set the Quaternion from Euler angles.

This can be done, though… like this:

public var NewGunRot:Quaternion = Quaternion.identity;;

NewGunRot.eulerAngles = Vector3(( DefaultRot.x+ RotateOnX, DefaultRot.y+ RotateOnY, DefaultRot.z);