Specify distance with Translate

transform.Translate seems to be doing almost exactly what I want it to, only instead of continuous movement over time, I want to translate an object along one axis, ONE time a set distance.

Ex: I have my camera pointing at the player, and I want to simply ‘translate’ the camera along its z axis to a specified distance FROM the player.

How can I do this? Should I be using something other than transform.Translate?

Here’s what I’m doing but it just makes the camera track away from the player infinity:

	transform.Translate(0,0, distToPlayer, target.transform);

var insertzZAxisHere : float;
var theCamera : GameObject;

function Start ()
{
    	
}
    
function Update ()
{
transform.position.z = theCamera.transform.position.z + insertzZAxisHere;
}

You can do something like that

Try this:

transform.Translate(transform.up.normalized * yourDistance);