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 eudb91 · Jan 21, 2015 at 02:21 PM · guitext4.6how-to

adding GUI text in 4.6.1f1

im following the beginning tutorial "roll-a-ball" using unity version 4.6.1f1 im currently on lesson 7 "displaying text". while going through the lesson the video tells me to add a GUItext.. so i go to gameobject... i see no GUI text tab...so i figure ok go to UI tab..and i see a text option..so i click it...then from their its all messed up.. plz help

if u want the link to the video it is link text my issues start @ 1:50

thx u 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

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Kiwasi · Jan 22, 2015 at 09:34 AM

Forget GUIText, there is no particular reason to learn to use a GUIText any more. There is an updated version of the video here.

http://www.youtube.com/watch?v=IViD5G2ucNs

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 Mmmpies · Jan 22, 2015 at 09:37 AM 0
Share

Even better, good find @Bored$$anonymous$$ormon

avatar image Kiwasi · Jan 22, 2015 at 09:46 AM 0
Share

Find? I got frustrated at answering this question so I rewrote the tutorial for 4.6

avatar image Mmmpies · Jan 22, 2015 at 09:56 AM 1
Share

You know that bit where people write lol but haven't actually laughed out loud. The opposite of that! :-)

Cheers @Bored$$anonymous$$ormon

avatar image
0

Answer by Mmmpies · Jan 21, 2015 at 02:25 PM

Click on Add Component on your empty gameObject as GUIText is still available in 4.6 just not in the same place.

EDIT

Did you set the transform to origin like it says in the video?

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 eudb91 · Jan 22, 2015 at 08:26 AM 0
Share

Click on Add Component on your empty gameObject as GUIText is still available in 4.6 just not in the same place.

ok that kinda worked... but now its not displaying in the game screen...ive added text into it anchored to the upper left where i would want it... made bright red text (so it will stand out for now) size 50 font (so it can stand out...) alt text

screen shot.png (36.4 kB)
avatar image
0

Answer by Mischief Manager · Feb 23, 2015 at 05:48 AM

EDIT: Beginner here, having similar issues getting the GUItext to appear in the Character Controller script in Inspector.

The updated video linked to youtube didn't work for my either, and in following Richards instructions I now have more errors to work around.

Basically, the script didn't' work, so I tried closing down and reopening Unity and now I see an error in the Player Controller script within Inspector which says the "script can't be loaded". Upon opening the script is gives me another error, "Object reference not set to an instance of an object."

Also might as well mention it, not sure what this means, but I noticed that whilst editing the Character Controller script using the newer Lesson video, when creating the new "public text countText" variable, there are no completions for "text" that show up for me, and the word appears red instead of blue after the line of code is finished. Specifically, it says "no completions found" when typing in. I noticed this was not the same for Richard in his video. It does turn blue when I capitalize to "Text" but i get the same errors..

Oh well, it sucks that I can't finish this today, I might as well move on to another Lesson and just keep working at Unity. I'll save the project for later date so if anyone bothers to make sense of this I'll complete it.

EDIT 2: Wow. So the parsing error i was troubleshooting, specifically "error CS0246: The type or namespace name `text' could not be found. Are you missing a using directive or an assembly reference?", i have been working on it for hours. Rewriting lines of code, capitalizing, lowercasing, searching the net for advice etc. Just now I retyped the line and it just worked. No more errors and the word "text" was recognized as reference finally. Very silly. The Count Text option appeared the Player Controller section for me and I'm finally good to move on. yay.

Here is my script below for anyone having the same problem. This is playable for me with no errors.

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
 public class PlayerController : MonoBehaviour{
 
     public float speed;
     private int count;
     public Text countText;
 
     void Start (){
         count = 0;
         SetCountText ();
     }
     void FixedUpdate (){
         float moveHorizontal = Input.GetAxis("Horizontal");
         float moveVertical = Input.GetAxis ("Vertical");
         Vector3 Movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
         rigidbody.AddForce(Movement * speed * Time.deltaTime);
     }
     void OnTriggerEnter (Collider other){
         if (other.gameObject.tag == "Pickup"){
             other.gameObject.SetActive (false);
             count = count +1;
             SetCountText();
         }
     }
     void SetCountText (){
             countText.text = "Count: " + count.ToString ();}
 }
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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make a FLASH 4 Answers

How Do I Make My Player Fall Through? 1 Answer

Unity 4.6 - Interactable UI Elements 1 Answer

[4.6 GUI] Source of event 1 Answer

Unity 4.6 - Editor Scripting - Add Reflection Method as a Persistent Listener 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