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 /
  • Help Room /
avatar image
1
Question by taymakes · May 03, 2017 at 11:41 AM · uiguitextguitextscore system

GUI Text not showing up :(

Hi everyone,

I'm a huge newbie to coding! I was following the Scroller Shooter Tutorial and making tweaks to the code to make it work for my purposes. I'm trying to add the score to the top right corner. However the GUI text refuses to show up! I have made an empty game object, added the GUI text component, made sure it was on the UI layer, checked it wasn't behind other objects on the z axis... idk I tried everything I could possibly think of and it's still not showing up in Game mode or Scene mode.

I have gotten it to work before, but this is a different save file of the game and for some reason it refuses to render just on this file!! I'm not sure if it's something I've done in my camera settings or something.

I am an artist not a coder, and I am just making a quick demo of my assets to try and get a coder partner for a future project, so I don't have extensive coding knowledge but if anyone has any idea what might be causing this please let me know!!

Thanks in advance!

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

7 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by gorgiaunity · Jan 14, 2018 at 08:23 PM

@taymakes there's a very simple way to solve it. You have to Add GUI Layer component to the Main Camera object, click on AddComponent>Renderering>GUILayer. If it won't work anyway, try creating an Empity Child for the Main Camera - by the Create menù in the Hierarchy folder - add the GUI Layer component to the new object and set its properties as Main Camera's. I hope it'll help you :)

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 AddCodeluck · Jan 16, 2018 at 10:30 PM 0
Share

This worked for me. Thanks!

avatar image
2

Answer by rctacbad · Feb 28, 2018 at 06:11 PM

I had the same problem when i tried the tutorial. Since GUIText is already deprecated, I used the Text gameObject instead. To create one select Create > UI > Text in the Hierarchy View. The usage is the same except you have to use the "Text" type when scripting (e.g. public Text scoreText;).

Thankfully, I already finished the Roll-a-ball tutorial where the Text gameObject was used and explained in the "Displaying the Score and Text" assignment.

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 BiscuitJoe · May 11, 2018 at 02:22 AM 0
Share

this is the exact answer.

avatar image
1

Answer by onur84 · Jan 18, 2019 at 12:55 AM

I have experienced a similar problem which might be relevant.

When I changed a child object (text changed to "Best Fit) my canvas became invisible.

After a long time of investigation I have found where was the problem; at the most simple place that I have not looked at:

Canvas's scale was set to x=0 y=0 z=0 automaticly. I set all of them to 1 and it is done.

I know that is a very stupid thing but please check this before changing a lot of prefabs, settings and scripts.

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

Answer by RecyclingBen · May 03, 2017 at 11:43 AM

Is your text a child of a canvas object? If it isn't right click and go to UI>Canvas and parent it to your UI text.

Hopefully this is your problem, but if it isn't then could you give us a screenshot of what your hierarchy looks like?

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 Mischief1 · Jun 03, 2017 at 12:14 PM 0
Share

i have the same problem and did everything u said. what should i do?

avatar image
0

Answer by SCoallier · Sep 20, 2017 at 10:33 PM

@taymakes I had this problem...what worked for me was attaching the GUIText object to a new, empty object as you have done and making sure that empty object had a zeroed-out Transform.

Also keep in mind that the X and Y values for a GUIText object are in screen space, not Unity space, and the range for them is 0 to 1 - so X=.5, Y=.5 is the middle of the screen. You can use the Pixel Offset coordinates to make finer adjustments.

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
  • 1
  • 2
  • ›

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

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

TextUI text changes size if resolution changes 1 Answer

Why is this List only showing one int? 0 Answers

Display rigidbody speed to a world space canvas text 2 Answers

GUI Text showing even if the 'if' statement is not met 1 Answer

I have a score displayed constantly in my game, but I can't get it to work for my game-complete screen? Help? 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