distance to variable object

i’m using this part of my java script to find the distance, but how can i instead make it find the distance of the transform variable ‘target’ from a transform variable ‘turret’?

var dist : float = Vector3.Distance(target.position, transform.position);

thanks

Well it appears that you just want to do:

   var dist : float = Vector3.Distance(target.position, turret.position);