4 Error on my script.

Scripts/aim 2.js(19,41): BCE0017: The best overload for the method ‘UnityEngine.Vector3.Lerp(UnityEngine.Vector3, UnityEngine.Vector3, float)’ is not compatible with the argument list ‘(UnityEngine.Quaternion, UnityEngine.Vector3, float)’.

Scripts/aim 2.js(19,41): BCE0022: Cannot convert ‘UnityEngine.Vector3’ to ‘UnityEngine.Quaternion’.

Scripts/aim 2.js(25,41): BCE0017: The best overload for the method ‘UnityEngine.Vector3.Lerp(UnityEngine.Vector3, UnityEngine.Vector3, float)’ is not compatible with the argument list ‘(UnityEngine.Quaternion, UnityEngine.Vector3, float)’.

Scripts/aim 2.js(25,41): BCE0022: Cannot convert ‘UnityEngine.Vector3’ to ‘UnityEngine.Quaternion’.

Can anyone fix these errors?

#pragma strict

var HipPose : Vector3; 
var AimPose : Vector3;
var HipRot : Vector3;
var AimRot : Vector3;
var AimSpeed = 0.5;

function Start () 
{ 
  transform.localPosition = HipPose;
} 

function Update () { 

if(Input.GetButton("Fire2"))
{ 
  transform.localPosition = Vector3.Lerp(transform.localPosition, AimPose, AimSpeed * Time.deltaTime);
  transform.localRotation = Vector3.Lerp(transform.localRotation, AimRot, AimSpeed * Time.deltaTime);
} 

if(!Input.GetButton("Fire2"))
{ 
  transform.localPosition = Vector3.Lerp(transform.localPosition, HipPose, AimSpeed * Time.deltaTime);
  transform.localRotation = Vector3.Lerp(transform.localRotation, HipRot, AimSpeed * Time.deltaTime);
}
}

Expanding on what iwaldrop said:

Lines 19 and 25 are where the problem lies. There it looks like you are trying to interpolate (“lerp”) a rotation, which is a Quaternion. The error is that you are using Vector3.Lerp() where you should be using Quaternion.Lerp().

transform.localRotation = Vector3.Lerp(transform.localRotation, AimRot, AimSpeed * Time.deltaTime);

For line 19, it should probably be:

transform.localRotation = Quaternion.Lerp(transform.localRotation, Quaternion.Euler(AimRot), AimSpeed * Time.deltaTime);

Just as a side note

Something you should keep in mind is that passing the value you want to interpolate as the from value will mean that the difference between from and to will become infinitely small but, theoretically, never quite reach zero. The effect is that the lerp will slow down over time but will never complete (if complete is the right word). It’s not invalid, but it may not be the desired effect.