x


make Guitext follow cursor

what I want to do is simple enough I think but I don't know anyway I can do it. my cursor is unlocked so it can move around the screen in my game, I want to have a gui text follow the cursor, or rather, always be over the cursor. how can I do that?

more ▼

asked May 05 '10 at 08:57 PM

Jordan Miller 2 gravatar image

Jordan Miller 2
348 47 51 57

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Use ScreenToViewportPoint:

function Update () {
    transform.position = camera.main.ScreenToViewportPoint(Input.mousePosition);
}
more ▼

answered May 05 '10 at 09:14 PM

Eric5h5 gravatar image

Eric5h5
81.5k 42 133 529

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x319
x202

asked: May 05 '10 at 08:57 PM

Seen: 1635 times

Last Updated: May 05 '10 at 08:57 PM