From the camera's (transform.position) print text

Hi, I have a sphere with a cursor on it, I basically want text to be printed when the position of the cursor is around... say the value of 1 on x AND y (so could be either side by 1 or 2 more) thus giving a kind of "radius" for the cursor to be within.

EDIT: Okay I'll explain better: I have a "globe" object with camera "orbiting" around it, I want a label to appear when the camera is at a certain position, imagine that it was facing America at 1.5,1.5 but America is more than just a single co-ord, its around 1-1.8,1.2-1.7 of the cameras transform position. as far as a "cursor" i've made an alpha sphere over the globe and make a dot texture to always face camera, SO its always centre of the camera position.

EXAMPLE: http://vimeo.com/16670934


  • The main issue is to get a radius of transform.position - X=1 up to X=1.5 and Y=1 up to Y=1.5

function Update () 
{
    if (transform.position.x == 1)
    { print("Bingo") }
}

is my basic attempt - Caius

this is what you might need for the orbiting camera

function Update()
{
if(transform.rotation = Vector3(//first number, //second number, //third number))
{
print(America!)
}
}

Hope this helps! oh, and nice work on the earth and everything on the video. looks good!

To find the camera rotate position use this, although I'm still working on a way to getting a radius of a position.

function Update()
    {
        if(transform.eulerAngles == Vector3(0,0,0))
    {
        print("America");
    }
       else
    {
        print(Quaternion.Dot (transform.rotation, Quaternion.identity));
    }

}