x


How to check if Mouse is touching GUI Texture

How do you check if the mouse is touching a GUI texture in scripting (I am trying to use an "if" statement, not a function). As in:

function Update () { 
   if (?){ 
      camera1.enabled = false; 
      camera2.enabled = true; 
   } 
   if (?){ 
      camera1.enabled = true; 
      camera2.enabled = false; 
   }     
}
more ▼

asked Jan 14 '11 at 06:28 AM

pigi5 gravatar image

pigi5
145 22 23 35

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

1 answer: sort voted first

No need for Update, just use OnMouseOver/OnMouseExit.

more ▼

answered Jan 14 '11 at 06:35 AM

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:

x5270
x3811
x2275
x1001
x9

asked: Jan 14 '11 at 06:28 AM

Seen: 1877 times

Last Updated: Jan 14 '11 at 06:33 AM