BCE0023 error

BCE0023: No appropriate version of ‘UnityEngine.Mathf.SmoothDamp’ for the argument list ‘(float, System.Object, float)’ was found.
I am getting this error from my script:

   var cameraObject : GameObject;
var targetXRotation : float;
var targetYRotation : float;
var targetXRotationV : float;
var targetYRotationV : float;
var rotateSpeed : float = 0.2;
var holdHeight : float = -0.2;
var holdSide : float = 0.2;

function Update () {
 transform.position = cameraObject.transform.position + (Quaternion.Euler(0,targetYRotation,0) * Vector3(holdSide, holdHeight, 0));
 targetXRotation = Mathf.SmoothDamp( targetXRotation, cameraObject.GetComponent(MouseLook).xRotation.targetXRotationV, rotateSpeed);
 targetYRotation = Mathf.SmoothDamp( targetYRotation, cameraObject.GetComponent(MouseLook).yRotation.targetYRotationV, rotateSpeed);
 transform.rotation = Quaternion.Euler(targetXRotation, targetYRotation,0);

why is this?

The error message tells you exactly why. Because targetXRotationV and targetYRotationV are “System.Object” references but SmoothDamp() expects them to be of type “float”. This is documented.

static function SmoothDamp (current : float, target : float, ref currentVelocity : float, smoothTime : float, maxSpeed : float = Mathf.Infinity, deltaTime : float = Time.deltaTime) : float

You need to look at what type those variables are and see if you can cast them to float. Simple as that.

xRotation.targetXRotationV and yRotation.targetYRotationV don’t exist in the original MouseLook.cs script - xRotation and yRotation are just float variables, thus they could not reference anything else.

Maybe you should use this instead:

var mLook: MouseLook = cameraObject.GetComponent(MouseLook);
targetXRotation = Mathf.SmoothDamp(targetXRotation, mLook.xRotation, rotateSpeed);
targetYRotation = Mathf.SmoothDamp(targetYRotation, mLook.yRotation, rotateSpeed);

NOTE: This will only work if Axes = MouseXAndY in the MouseLook script instance - xRotation isn’t used when MouseX or MouseY are selected.