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 Clarinet · Aug 07, 2012 at 09:01 PM · instantiategui text

Instantiate GUI text

Hey there, I was wondering if it was at all possible to Instantiate a GUI text just as you would a game object. Here is a JS of what works for a regular game object:

 var object : Transform;
 function OnTriggerEnter(hit : Collider){
 Instantiate(object, Vector3(3,5,7),Quaternion.identity);
 }

So, I'm kinda thinking it might be the same to perform an operation like this only with a GUI text instead of a regular 3D game object. If so, I'd really like to know how, but if not, I'd like to know that too. Thanks!

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 teja6595 · Jun 28, 2016 at 09:25 AM 0
Share

i try to instantiate gui text on a panel but the clone text is no displaying on the parent panel...alt text

here is the c# code which i have used.... alt text

screenshot-183.png (170.3 kB)
screenshot-184.png (2.2 kB)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ScroodgeM · Aug 07, 2012 at 09:02 PM

GUIText is a GameObject like almost all other. so you could do with it everything you could do with GameObjects. just remember that GUIText uses it's position by it's own rule to display 8)

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 Clarinet · Aug 07, 2012 at 09:10 PM 0
Share

Simply put, if it's turned off (unchecked to the left of the name), that makes it not show, but once the trigger object is touched, I'd like it to show. Is there a way to do that?

avatar image ScroodgeM · Aug 07, 2012 at 09:13 PM 0
Share

void OnTriggerEnter(Collider other)
{
    GetComponent<GUIText>().enabled = true;
}
avatar image Clarinet · Aug 07, 2012 at 09:27 PM 0
Share

Sorry, that didn't exactly work. Is it JavaScript? Where does it go? How does it apply to the GUI text?

avatar image ScroodgeM · Aug 07, 2012 at 09:31 PM 0
Share

this is C#. is method should be in script, that attached to object with trigger and guitext components

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

9 People are following this question.

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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Creating an object and setting fields before object begins running 1 Answer

Instantantiate relative to parents position 1 Answer

AddComponent() causes a "trying to create a MonoBehaviour using the 'new' keyword" warning 2 Answers

How to call a MainClass Funktion ? 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