Hi, i am having problems getting the length of a plane.I am getting the center of the plane via Camera.main.WorldToScreenPoint(plane.position) but cannot find a way of getting the length of one size of the plane.How would i get the bounds of this plane?Could anyone help me pls?
The answers is the following;
var min : Vector2;
var max : Vector2;
var distanceInPixels : float;
var target : Transform;
function Start ()
{
min = Camera.main.WorldToScreenPoint(target.renderer.bounds.min);
max = Camera.main.WorldToScreenPoint(target.renderer.bounds.max);
distanceInPixels = Vector2.Distance(min, max)/2;
//distanceInPixels is the radius of the target.
//You get the radius so calculate the rest..
}