- Home /
mouse over for 3d menu
How can I make it to where when my mouse goes over a button for my 3d menu the button pops out and when the mouse is off it the button goes back in and upon clicking on it it does the application.loadlevel ordeal this is the code i have and i kno it works with buttons but i want to use the mouse please help me. Thank You
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
iTween.MoveTo(gameObject,{"z":-1, "time":1});
}
else if(Input.GetButtonUp("Fire1"))
{
iTween.MoveTo(gameObject,{"z":0, "time":1});
}
}
that is my code im using right now and that works but i have more than one button and again i want to use the mouse any help or direction is greatly appriciated.
Answer by Berenger · Mar 18, 2012 at 09:15 PM
You need a script with OnMouseEnter and OnMouseExit function on those objects, with a Collider.
ok well i would have put a comment but there is no button where it used to be to add a comment so i have to put it here....anyway ok with the On$$anonymous$$ouseEnter and On$$anonymous$$ouseExit where is the collider used is it used one per button or a big collider to cover all the buttons ive never used that function call before so im completely new to it please a lil bit more of a hint if you can thank you.
I figured it out thank you very much $$anonymous$$antoue.
Your answer
Follow this Question
Related Questions
3D Menu Help 1 Answer
Use yield WaitForSeconds to delay mouseover on a gameObject? (JS) 1 Answer
how to set a texture and another font in a GUI Text 2 Answers
How do I make music continue through certain scenes 1 Answer
Enemy doesn't face player 0 Answers