Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by Kalu · Jul 12, 2011 at 09:40 AM · gameobjecttransformguitext

guiText/GameObject position

I try to set up a guiText above a gameobject and I realize that the position of one is linked to the position of the other:

oLoader.guiText.transform.position = new Vector2(0.2f, 0.2f);

This code places the guiText correctly but also acts on the gameobject and replace with the same coordinates

oLoader.transform.position = new Vector3(55f, 70f, -85f);

This code places the gameobject correctly in 3D space but guiText've been in and out of the screen

Have an idea? :)

Sorry for my english, GoogleTrad is a good english Friend.

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
2

Answer by aldonaletto · Jul 25, 2011 at 03:13 AM

You can use a script from @Eric5h5 called ObjectLabel - click here to access it. It associates a GUIText to some object, and works even if the object moves.

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 YikYikHeiHei · Jul 12, 2011 at 11:24 AM

guiText position X range is 0-1 and position Y range 0-1 too.

 function Start ()
 {
     this.transform.position = new Vector3(0.3f,0.7f,1.0f);
 }

This code places in the guiText gameobject.

 var oLoader : GameObject; // place your guiText

 function Start ()
 {
     oLoader.transform.position = new Vector3(0.5f,0.7f,1.0f);
 }

Or you can places this code in a gameObject.

I think it can help you.

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 Kalu · Jul 12, 2011 at 11:42 AM 0
Share

Two functions start? Currently I use a gameobject which I attach a GUIText. So for now I get the GUIText attach and I try to move it, but it also moves gameobject ..

How to divide your two functions start?

sorry this is my first week of Unity:)

avatar image YikYikHeiHei · Jul 25, 2011 at 01:09 AM 0
Share

It is two script, and the first script is attach your GUIText. and the last script is attach a gameObject.

avatar image Kalu · Jul 28, 2011 at 10:00 AM 0
Share

Thx, i'll try it. :)

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

My script doesnt respond what i wrote HELP!!! 0 Answers

How to destroy a transform's parent object. 1 Answer

Problems with Transform.Find and GameObject.find 1 Answer

Attach Transform to another GameObject 0 Answers

How To Move GameObjects In Fixed Path? 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