Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by dofe · Dec 04, 2012 at 02:59 AM · menuinvisibleselectvisible

Mouse over make object Visible

Hello i am new to unity, and I am still learning.

I am currently developing a menu, in this menu i have a background which is a image assigned to a plane. I made 3D text ( start, Credits, and Exit. behind each text i have set up planes with a texture assigned to it.

What i want to do is when i hover over my text or even just the area I want to make the plane behind the text visible, and when i am not over it, i want it to be invisible.

The text is not grouped to the plane

I need some Code that will make this possible.

could anyone help.

thank you Thomas

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by azmat786n · Dec 04, 2012 at 05:05 AM

make your background using gui texture and also make buttons using gui texture

 function OnGUI() {
     /*
     if(GUI.Button(Rect(x,y,width,height), Texture or "Text Strings"
    */
     
     if(GUI.Button(Rect(10,10,100, 50), "Button1")) {
       //make function here
       doSomething();
     }
 
     if(GUI.Button(Rect(10,700,100, 50), "Button2")) {
       //make function here
       doSomething();
     } 
 }


//// other tutorial you can find on youtube or unity3dstudent.com

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dofe · Dec 04, 2012 at 06:46 PM 0
Share

I don't want to use GUI buttons, how would I use this by what I have ???

avatar image dofe · Dec 04, 2012 at 08:06 PM 0
Share

if i would use the GUI, how would I set the position and scale of the button??

avatar image azmat786n · Dec 04, 2012 at 08:46 PM 0
Share

if(GUI.Button(Rect(xPosiotion, yPosition, ButtonWidth, ButtonHeight), ButtonTextOrTexture)) { call a function(); }

avatar image dofe · Dec 06, 2012 at 05:29 PM 0
Share

well if i click on the button it will trigger a animation on a different object. I just have to add the name of the object with the animation attached to it. ?

avatar image
0

Answer by azmat786n · Dec 04, 2012 at 07:38 PM

create guiskin right click inside project tab select create then click on guiskin. now select your gui skin just created look on inspector

expend (button>normal) select texture and text color.

expend (button>over) select as above.

expend (button>active) same as above.

now make a game object. put below script on that object.

 //select gui skin from inspector
 var guiskin:GUISkin;
 
 function OnGUI() {
     //setup gui skin to gui menu
     if(GUI.Button(Rect(Screen.width/2-100,Screen.height/2-100,50,200), "Start")) {}
     
     if(GUI.Button(Rect(Screen.width/2-100,Screen.height/2,50,200), "Credits")) {}
 
     if(GUI.Button(Rect(Screen.width/2-100,Screen.height/2+100,50,200), "Quit")) {}
 }
 


it can do that you want.. remove background texture from button>normal from guiskin. now when you mouse over on any button texture will show ..

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I make one object appear when I mouse over another object? 1 Answer

Converting C# to JS: rendering a mesh 1 Answer

get object invisible for couple seconds and get visible again 1 Answer

First selected GameObject not highlighted 3 Answers

how GUIText get visible? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges