- Home /
onmouseover javascript help
my script doesn't seem to be working and i can't figure out why. I want to test it on one mesh I made and hopefully implement it with several others. I have a rigidbody on the object as well as a mesh collider. it is not a trigger. any other ideas?
function OnMouseOver(other: Collider) { if (other.CompareTag ("computer1")) {
Debug.Log ("computer here");
}
}
Answer by · Jan 23, 2011 at 05:06 AM
OnMouseOver doesn't return or pass anything through.
All you need to do is attach this script to the object that should do something when the mouse is over it.
function OnMouseOver()
{
Debug.Log("Mouse is hovering over computer1")
}
but eventually i'm going to want it to do different things for different things that it mouses over. will that be possible then?
ahh wait i see. i was putting it on the player ins$$anonymous$$d of the object itself.
Your answer
Follow this Question
Related Questions
Why am I getting this error repeatedly? 2 Answers
BCE0049 error with networking script 0 Answers
IndexOutOfRangeExeption - Array index is out of range 2 Answers
How to make animations only play with script? 1 Answer
problem at adding script 1 Answer