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 /
This question was closed Apr 07, 2013 at 07:51 AM by AlucardJay for the following reason:

Question is off-topic or not relevant : UA is for Specific Technical Questions, not for asking for scripts.

avatar image
0
Question by inglipX · Apr 06, 2013 at 12:03 AM · guiobjectmouseover

Display Press E to Pickup when mouse over object

I've trying to get this to work for a while.... When i look at an object i want the words Press E to pickup to be displayed..only when im near the object and looking at it? Help please

Comment
Add comment · Show 1
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 Chronos-L · Apr 06, 2013 at 01:19 AM 1
Share

Do your research better, I Google using the following: "answers.unity3d.com display gui when mouse over"

Duplicated question:

http://answers.unity3d.com/questions/403683/display-guitexture-when-mouse-over-object.html

2 Replies

  • Sort: 
avatar image
0

Answer by HuskyPanda213 · Apr 06, 2013 at 01:48 AM

What you could do is either a OnMouseOver(){} void or function and the script must be added to the pickup object. Or you could use vector3.distance to make it that you pick it up when your near(Note: this will not use direction so you can pick it up without looking at it). I would go to the unity3d script reference and look up these two things, but they will not be great but its pretty hard to make it work perfectly.

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
avatar image
0
Wiki

Answer by DryTear · Apr 06, 2013 at 01:29 AM

 var Highlighted : boolean;
 var ChosenColour : Color;
 var PickUp : String = "This Cool Thing Im Looking At";

 function OnMouseOver(){
     transform.renderer.material.color = ChosenColour;
     Highlighted = true;
 }

 function OnMouseExit(){
     transform.renderer.material.color = Color.white;
     Highlighted = false;
 }

 function OnGUI(){
     if(Highlighted == true){
         GUI.Label(Rect(Screen.width/2,Screen.height/2,200,20),"Press E to Pick up "+PickUp);
     }
 }
Comment
Add comment · Show 3 · 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 DryTear · Apr 06, 2013 at 01:30 AM 0
Share

Place it on the gun

avatar image inglipX · Apr 06, 2013 at 09:48 PM 0
Share

error - BCE0023: No appropriate version of 'UnityEngine.GUI.Label' for the argument list '(String)' was found.

avatar image DryTear · May 01, 2013 at 12:09 AM 0
Share

Fixed code

Follow this Question

Answers Answers and Comments

13 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 avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Cant find specific GUI Object thing 1 Answer

How do Text Fields work? (Backend) 1 Answer

Trying to Destroy Object when Wave starts 1 Answer

Screenshot certain layers so it doesn't show GUI Button on the image?? 0 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