Unity3D error BCE0043: Unexpected token: ..

Hey I am new to unity, and I am working on a script from EteeskiTutorials watching episode FPS1.8 And I have got this error.
BCE0043: Unexpected token: …

And here is my Script

var cameraObject : GameObject;

@HideInInspector 

var targetXRotation : float;

@HideInInspector 

var targetYRotation : float;

@HideInInspector 

var targetXRotationV : float;

@HideInInspector

var targetYRotationV : float;



var rotationSpeed : float = 0.3;



var HoldHeight : float = -0.5;

var HoldSide : float = 0.5;



function Update () 

{

    transform.position = cameraObject.transform.position + (Quaternion.Euler(0,targetYRotation,0) * Vector3(holdSide, holdHeight, 0));

    

    vartargetXRotation = Mathf.SmoothDamp( targetXRotation, cameraObject.GetComponent(MouseLook).xRotation, xRotationV, rotationSpeed);

    var targetYRotation = Mathf.SmoothDamp( targetYRotation, cameraObject.GetComponent(MouseLook).xRotation, yRotationV, rotationSpeed);

    

    var transform.rotation = Quaternion.Euler(targetXRotation, targetYRotation, 0);

}

this line:

var transform.rotation = ...

is incorrect. if you need to declare some variable, it should have a solid name without dot

var transformRotation = ...

and if you want to change transform’s rotation, you should not declare it:

transform.rotation = ...

Here is your script edited and fixed. Your unexpected token and most of your errors cam from line 33:

var transform.rotation = Quaternion.Euler(targetXRotation, targetYRotation, 0);

This should be changed to:

transform.rotation.eulerAngles = Vector3(targetXRotation, targetYRotation, 0);

You are editing the objects rotation so you need to get it’s eulerAngles variable. Then set it to your new values as a Vector3 object. This does not need to be a variable so you need to remove the var keyword.
Generally you need to be careful when naming your variables. The references are case sensitive so ‘holdSide’ is different from ‘HoldSide’. Just be careful when copying from tutorials. I often find watching videos in HD on youtube makes a big difference to the readability of the code. Here is the fully edited code:

#pragma strict
var cameraObject : GameObject;

@HideInInspector

var targetXRotation : float;

@HideInInspector

var targetYRotation : float;

@HideInInspector

var targetXRotationV : float;

@HideInInspector

var targetYRotationV : float;

var rotationSpeed : float = 0.3;

var HoldHeight : float = -0.5;

var HoldSide : float = 0.5;

function Update ()

{
transform.position = cameraObject.transform.position + (Quaternion.Euler(0,targetYRotation,0) * Vector3(HoldSide, HoldHeight, 0));



var targetXRotation = Mathf.SmoothDamp( targetXRotation, cameraObject.GetComponent(MouseLook).xRotation, targetXRotationV, rotationSpeed);

var targetYRotation = Mathf.SmoothDamp( targetYRotation, cameraObject.GetComponent(MouseLook).xRotation, targetYRotationV, rotationSpeed);



transform.rotation.eulerAngles = Vector3(targetXRotation, targetYRotation, 0);
}