x


OnMouseEnter not working

I don't understand why this isn't working, I've a cube on the scene with a simple collider, in the OnMouseEnter a simple print("hello") for testing, but when I move the mouse over the 3d object the function isn't called. Am I forgetting something? What the problem could possibly be?

more ▼

asked Feb 22 '12 at 09:18 AM

sonic220 gravatar image

sonic220
34 19 24 32

Here's a silly question: Is the script attached to the gameobject?

Feb 22 '12 at 11:24 AM CHPedersen

Yes it is, I really don't know what to do.

Feb 22 '12 at 11:50 AM sonic220

Already looked at it, seems like all is set up correctly, but it doesn't work

Feb 22 '12 at 12:50 PM sonic220

do you have another collider blocking the collider you're trying to come into contact with?

Feb 22 '12 at 12:56 PM Kacer
(comments are locked)
10|3000 characters needed characters left

2 answers: sort oldest

where u attached script (where u make function OnMouseEnter )on cube or not, if u attached on cube then it will work perfectly.

more ▼

answered Feb 22 '12 at 04:05 PM

James Tima gravatar image

James Tima
36 1

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

The object using OnMouseEnter must have a collider. Check if yours does.

more ▼

answered Feb 22 '12 at 05:56 PM

aliakbo gravatar image

aliakbo
145 10 14 16

(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:

x1682
x982
x38
x15

asked: Feb 22 '12 at 09:18 AM

Seen: 1869 times

Last Updated: Feb 22 '12 at 05:56 PM