so i want a target position for my camera to move to be -10 away from the current x position of an object. I got this and got stuck.
function moveCamera () {
var myVar : double;
myVar= GameObject.Find("First Person Controller").transform.position.x;
myVar-= 10;
transform.position = Vector3.MoveTowards(transform.position, myVar, .05);
}
The Consoles says that I cannot use myVar in the MoveTowards because it uses a Vector3 but then i cannot subtract the 10 from myVar if it is a vector3.
Thank you in advance.
↧