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 NeroValentin · Jan 31, 2015 at 07:08 PM ·

Trying to make a score script that shows the score through a GUIText object.

I'm very new to unity and C# but I'm trying to make a script that keeps track of the player's score and displays it through a GUIText object.

So far I have the GUIText object and I've set it as child of the main camera but it doesn't stay in the camera's view and I'm not sure why. In my score script I have score declared as a variable and in void update() I convert it to a string but I'm not sure how to display it in the GUIText object.

Does anybody know a good tutorial that could help me understand what I'm doing wrong?

Thanks in advance for any help and I'm sorry if this is a stupid question.

Comment
Add comment · Show 2
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 Glurth · Feb 01, 2015 at 04:38 AM 0
Share

Don't know which video cover exactly what your asking, but watching all the vids here, with experiments in between will save you OODLES of time. http://unity3d.com/learn

avatar image MD_Reptile · Feb 01, 2015 at 04:56 AM 0
Share

if the GUIText is not view-able by the camera (check in 'game' view without running the game to see if it shows up in the right location) then maybe you haven't set the GUIText's transform right - it should be between 0 and 1 with 0.5 being the center of the screen. Any number less than 0 and more than one for its transform x and y will have it appearing offscreen...

Oh and PS, you can set the GUIText's variable "text" to change the text you see on it - so just get a reference to it at the top of your script, like public GUIText $$anonymous$$yGUIText; and then set in inspector - and you can do $$anonymous$$yGUIText.text = "$$anonymous$$y New Text " + 1; to change it to a different value.

0 Replies

· Add your reply
  • Sort: 

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

Trying to Tackle ledge climbing with blender animated Character!! 0 Answers

Running Unity FREE license on school computers 1 Answer

randomized jumpscare not working! 0 Answers

Reference error -_- Annoyed please help 1 Answer

Collider has illegal parameters 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