- Home /
Mouseover script (C#)
hey guys! what I want is a thing that unity returns true if I have my mouse over a gameobject, maybe with a tag. im not the best at scripting so I don't even have an idea of what to do here.
hope some awesome people can help me! XD
You can attach a simple script to that gameObject with On$$anonymous$$ouseEnter.
Questions like this aren't good. You're basically asking "I have this thing I want do do, can you write a script for me?"
What you're trying to do is very simple, look at the link @nixcs2512 provided.
If you don't understand scripting, you should do some program$$anonymous$$g tutorials before trying to build a game, because we aren't going to build your game for you.
Answer by ivan2532 · Aug 07, 2013 at 10:58 AM
Hello phil2988! You should use the OnMouseEnter fuction. Here is the example code:
C#
void OnMouseEnter()
{
//Do something
}
JS
function OnMouseEnter()
{
//Do something
}
When you are attaching these scrpts, you need to attach them on a game object.
Ivan Bozovic
Your answer
Follow this Question
Related Questions
the textures look bad 1 Answer
I open my project and I found that everything's gone?! 2 Answers
Help to code line of bullet like gunbound ! 1 Answer
Help! My script wont work! 1 Answer
Player model doesn't stay on ground 1 Answer