- Home /
Answer by Edwige · Apr 10, 2011 at 08:38 PM
You can use the WorldToScreenPoint function.
Example : var screenPos : Vector3 = cam.WorldToScreenPoint(3dobject);
Where cam is your camera, 3dobject is the position (vector3) of your 3D object in the scene.
Hope it helps :)
I've been trying to use this for an in-world 3D cursor but I am running into a problem. It maps the objects 0,0,0 to its screen position correctly when th object is at the center of the screen, but the further away from center I go either horizontally or vertically the further the screen point drifts from where the object's 0,0,0 is actually drawn.
@jeff $$anonymous$$esselman, please don't post new questions as comments on answers. (especially 3 year old posts)
Your answer
Follow this Question
Related Questions
3d object on GUI 1 Answer
GUI Label follow an object? 4 Answers
How do I position a GUI Label over an object? 1 Answer
GUI item with object position+dimensions 0 Answers