I am trying to find the size in pixels of a displayed mesh.
Debug.Log("BOUNDS" + renderer.bounds);
Vector2 p1 = camera.WorldToScreenPoint(renderer.bounds.center - renderer.bounds.extents / 2.0f);
Vector2 p2 = camera.WorldToScreenPoint(renderer.bounds.center + renderer.bounds.extents / 2.0f);
Debug.Log("p1" + p1 + " p2" + p2 + " size " + (p2 - p1).ToString());
but the size seems wrong.
For example if the object is filling the width of a 400x400 screen I am getting the width to be 305
Thanks in advance for any help