I am making a gun sway script from ETesskie tutorials and keep getting this error. does any one know how to fix it.
here is the error
Assets/GunScript.js(31,62): BCE0051: Operator '*' cannot be used with a left hand side of type 'UnityEngine.Vector3' and a right hand side of type 'UnityEngine.Vector3'.
here is the code (thank you for the help)
var cameraObject : GameObject;
@HideInInspector
var targetXRotation : float;
@HideInInspector
var targetYRotation : float;
@HideInInspector
var targetXRotationV : float;
@HideInInspector
var targetYRotationV : float;
var rotateSpeed : 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));
targetXRotation = Mathf.SmoothDamp( targetXRotation, cameraObject.GetComponent(MouseLookScript).xRotation, targetXRotationV, rotateSpeed);
targetYRotation = Mathf.SmoothDamp( targetYRotation, cameraObject.GetComponent(MouseLookScript).yRotation, targetYRotationV, rotateSpeed);
transform.rotation = Quaternion.Euler(targetXRotation, targetYRotation, 0);
}