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
0
Question by rTECH · Jan 23, 2016 at 06:19 PM · textuser interface

Unexpected text appears using UI

I'm creating my very first game in which a ball is repairing objects. When I enter the collider of an object, a text appears under the simple minimap saying "In repair..." with a countdown and when the countdown is over, it turns into "REPAIRED". This is all good, but when I enter the collider for the 2nd time before OR after it is repaired, the following strange, upside-down text appears for a very brief time (couple of frames maybe):alt text No text should appear here.

In comparison, this is what I should normally see (and I do see it after a frame, please disregard the glowing element, it is not connected to the text):alt text I paste the script controlling the behavior of the text here :

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
     public class RepairText : MonoBehaviour {
     public Text repairText; //reference to the text comp
     public GameObject metaBallTrigger; // reference to the GO trigger
     public SpinningSiren refSiren; //reference to the script attached to the player
     public GameObject collectible; //reference to the collectible GO
     public RepaireCollectible repColText; //reference to the script attached to the collectible
 
     void Start ()
     {
         repairText.enabled = false;
         refSiren = metaBallTrigger.GetComponent<SpinningSiren>(); //using script from the trigger GO
         repairText.text = "";
     }
     
     
     void Update ()
     {
         if (refSiren.inRepair) //if inside the collider of the collectible
         {
             repColText = refSiren.repairCollectible;
             repairText.enabled = true; //text appears
             if (!repColText.repaired) //if it is not repaired yet
             {
                 repairText.text = "In repair... " + ((int)repColText.timer).ToString(); //float timer is converted to int to display conventional 1, 2, 3, etc.
             }
             else
             {
                 repairText.text = "REPAIRED"; //if repaired, display this
             }
         }
         else //if not in repair
         {
             repairText.text = "";
             repairText.enabled = false;
         }
     }
 }

To me, it looks like some kind of memory garbage, but I have no idea. I tried to initialize the text in the beginning and set it back to "" if unused, but I am new to unity, so I don't know if I was right to do so. Has anyone seen anything like this?

flashtextnormal.png (69.1 kB)
flashtext.png (167.8 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by rTECH · Jan 24, 2016 at 08:53 AM

I captured two other, with different text. This time, I flipped the image and used a readable font. The text is different before and after I repaired the collectible. This is still very bizarre. Help is much appreciated :) before: alt text after: alt text


flashtext3.png (77.1 kB)
flashtext4.png (121.5 kB)
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

38 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 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 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

How can i ask a user for their name? 1 Answer

UI Text synchronize with UNET 1 Answer

Blurry UI Text until I modify it 0 Answers

Prevent escape key from deleting InputField contents, have it save instead? 4 Answers

Combine text and buttons in scroll rect 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