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 hizral84 · Jun 15, 2010 at 03:39 AM · guilearning

Teach me Label, speech bubble, overlay text, pop up box, etc

I need help..can someone teach me on how to do this, I've try look into unity and unity answer but still cannot understand the basic principale of doing this all type of dailog box.

and I try to find a tutorial about this, cannot find it anywhere..can someone point me to the right direction..

thank you..

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

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Adrian Love · Jun 15, 2010 at 03:56 AM

If you're having trouble with this I'd suggest reading through the lerpz tutorial. http://unity3d.com/support/resources/tutorials/3d-platform-game

What you could do is perhaps expand on the functionality of the lerpz game with a speech bubble dialog box.

Specifically for GUI dialog boxes I'd look at: http://unity3d.com/support/documentation/Components/GUI%20Scripting%20Guide.html

Good luck and welcome to unity.

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
-1

Answer by hizral84 · Jun 16, 2010 at 02:32 AM

okay..here's my code:

var target : GameObject;

function Start() { target.renderer.enabled = false; }

function OnTriggerEnter(hit : Collider) { if (hit.gameObject.tag == "Player") { target.renderer.enabled = true; print("ENABLED"); } else { target.renderer.enabled = false; print("DISABLE"); }

}

the code sort of work, when my Player is far away from the object the label is hide, and when I approch the object the label will hover above the object..but right now when my Player walk away from the object the label is still there and did not hide at all...

Comment
Add comment · Show 1 · 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 fireDude67 · Feb 10, 2011 at 02:34 AM 0
Share

Please do not post edits to questions as Answers

avatar image
0

Answer by Tetrad · Jun 16, 2010 at 04:17 AM

In response to http://answers.unity3d.com/questions/12451/teach-me-label-speech-bubble-overlay-text-pop-up-box-etc/12556#12556

Your logic for entering/exiting is wrong. You're basically checking to see if something other than the player entered the trigger, and if so to turn it off. You want something like this

function OnTriggerEnter( hit : Collider ) { if( hit.gameObject.tag == "Player" ) { // enable } }

function OnTriggerExit( hit : Collider ) { if( hit.gameObject.tag == "Player" ) { // disable } }

Comment
Add comment · Show 2 · 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 hizral84 · Jun 16, 2010 at 07:12 AM 0
Share

thanks, it help alot.

but still sorry if I ask this question, can we still contain everything in one trigger.

avatar image Tetrad · Jun 16, 2010 at 02:30 PM 0
Share

That is in one trigger. When you enter the trigger it turns on, when you exit it turns off.

avatar image
0

Answer by TheGeekyDead · Mar 25, 2014 at 04:18 PM

@ hizral84

It's because you only have an on trigger enter, and no exit lol. Maybe to late to help but it might help someone else idk.

I tested it works great, after i added exit to it.

 var target : GameObject;
 
 function Start()
 {
 target.renderer.enabled = false;
 }
 
 function OnTriggerEnter(hit : Collider)
 {
 if (hit.gameObject.tag == "Player")
 {
 target.renderer.enabled = true;
 print("ENABLED");
 }
 else
 {
 //target.renderer.enabled = false;
 //print("DISABLE");
 }
 }
 
 function OnTriggerExit (hit : Collider)
 {
 target.renderer.enabled = false;
 print("DISABLE");
 }
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

1 Person is following this question.

avatar image

Related Questions

GUI menu how to make a list in a list. C# 1 Answer

Is there anyway to only show a part of a GUI image during the game? (C#) 1 Answer

How Would I Make A GUI Label Fade After A Certain Amount Of Time? 1 Answer

UI elements problem 0 Answers

Disable one GUI Button with my Mouse Scroll Wheel? 1 Answer


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