• 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
Question by Dollarslice · Apr 15, 2012 at 06:02 PM · gameobjecttext

server side highscores tutorial: text on gameobject question

Hi there, I'm very new to unity and I've hit a little bit of a bump when following this tutorial. I have also posted the relevant text below, although without being too specific I think what I need to do is display text on a gameobject. What is the easiest way of doing this? How can I easily link the variable in any given script with a gameobject so that it will display on the screen when I run a program?

Thank you in advance.

(also bonus points if you can explain what he means by 'include' the md5 hash. How do I do that? put the script in a separate file and link them together.. how? thanks again!

 Step 3: The Unity HSController Script

 You will attach this script to a GameObject. You need to be able to supply it with a string containing the players name, and a 
 string containing the players score. You also need to edit the URLs in it that point to the correct addscore.php script and the
 display.php. You will also need to supply it with a GUIText if you want it to get the scores (otherwise you can ignore the     
 getScores() function).
 You will also need to include the MD5 script previously posted to this Wiki in your project folder.


Comment

People who like this

0 Show 0
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 Reply

· Add your reply
  • Sort: 
avatar image

Answer by AVividLight · Apr 15, 2012 at 11:21 PM

Hey SirYakalot,

If I were you, I would use a GuiText variable, and then reference it in the script using something like this:

YourGUIText = highscore;

where highscore is the string that is supplied by the tutorial's script, and YourGUIText is a GuiText variable declared at the top of the script. If I didn't do a good job explaining this, please let me know so I can give you a better example

-Gibson

-Edit-

The variable GuiText must be assigned to a GUIText GameObject [From GameObject>CreateOther>GUIText]

Comment

People who like this

0 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 Dollarslice · Apr 16, 2012 at 08:02 AM 0
Share

This is helpful, thank you. Would you mind just explaining the basics though? Is there a GUI text game object I drag into the scene? How do I then attach the variable? Are all scripts aware of all objects variables?

(really sorry for the newbie question!)

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Quest Script Help 2 Answers

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

How to make text appear when moving next to an object? 3 Answers

Unable to call another gameObject's script 4 Answers

C# Find Which Axes Gameobject is on 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