- Home /
Question by
oinkoinkflapflap · Jul 06, 2012 at 07:32 PM ·
javascripttransformpositionvector3distance
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
Comment
Best Answer
Answer by whydoidoit · Jul 06, 2012 at 07:42 PM
Well it appears that you just want to do:
var dist : float = Vector3.Distance(target.position, turret.position);
ah i tried using turret.transform.position thanks allot mike :)
Your answer
Follow this Question
Related Questions
Vector3 Transform.Position Not Working 2 Answers
Reposition to minimum distance from target 2 Answers
Finding Distances With Vector3 1 Answer
Distance won't work 1 Answer