2D Camera following Distance

Hey guys,

I am struggling, with a little problem that I have:
I started a 2D-Game, where the Camera follows my Character on the X and Y-Axis. But my problem is, the character is to close to the camera and I want adjust a defined distance. I looked on different tutorials, but nothing worked for me so far.

Here is my original following code

var Target : Transform;
public static var gameRunning : boolean = true;

function Update () {

if(gameRunning){
	transform.position.x = Target.position.x;
	transform.position.y = Target.position.y;
}
}

This is what I tried:

var distance : float = -200f;
var Target : Transform;
public static var gameRunning : boolean = true;

function Update () {

if(gameRunning){
	transform.position.x = Target.position.x;
	transform.position.y = Target.position.y;
	transform.position.z = distance;
}

}

Hope you can help me with that.

The OP was using a orthographic camera along with his 2D Scene. Moving an orthographic camera only changes position not how objects are viewed. Instead, changing the Size of an orthographic camera will allow you to ‘zoom’ to the target object.