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 affreuxgeorges · Oct 24, 2013 at 09:38 AM · androidbugstringchar

Android 4.2 strings bugs.

I'm wondering if this is a known bug or if I discovered a hidden awesome feature to make your texts unreadable...

alt text alt text

My code is really simple. I have a string and a textmesh. I increment the text mesh.text with a simple coroutine like this:

 public IEnumerator AnimText(TextMesh textmesh, float chartime){
 
         string displaytext="";
 
         for(int i=0;i<text.Length;i++){
 
             string s=text.Substring(i,1);
             displaytext+=s;
             textmesh.text = displayText;
             yield return new WaitForSeconds(chartime);
         }
 }

The fancy thing is the bug only shows up on recent android phones (android 4.2) and not every time ( I have more than 50 scenes with these animated titles and only 2 or 3 are misbehaving this way, and once again not every time and only on android 4.2 ). I'm searching on different directions now :

  • maybe the string.substring() behave weirdly on new android versions. maybe the string should be encoded to UTF or ASCII or whatever.

  • maybe a serialization problem (strings are serialized in the class on the scene, they are not saved as prefabs or stored in some xml extern file)

  • maybe a coroutine problem?

I'm in a hurry cos i'm releasing this app on unity/flash, android and ios and the client (MINI brand as you can see, my bad ;) want the project to be released in a couple of days. I had a lot to do to make all the versions behaving almost the same way and show the same overall quality (sound/graphics/functionalities). This is the only remaining bug on all these platforms and I can't figure out where the problem comes from and how to fix this. That's why I submit the fancy problem to your brilliant minds.

I know there is a jedi knight in here who can find the solution with his only mind's power ;)

"Obi Wan Kenobi, you're my only hope."

screenshot_2013-10-23-17-24-49.png (263.9 kB)
screenshot_2013-10-23-17-17-30.png (297.2 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
Best Answer

Answer by affreuxgeorges · Oct 25, 2013 at 08:42 AM

OK, I figured it out.

It was the dynamic font's texture that didn't update on some scenes, causing all missing characters to appear... transparent. I solved it by calling Font.RequestCharactersInTexture().

http://docs.unity3d.com/Documentation/ScriptReference/Font.RequestCharactersInTexture.html

It works perfectly now.

bye!

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

14 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

Related Questions

Device.Present or GFX.WaitForPresent 1 Answer

Probuilder throws ArgumentNullException when Extruding ProBuilder object on Android 0 Answers

How to implement Text Mesh text wrapping? 2 Answers

Problem with Sprites in Android. Maybe a bug? 0 Answers

Video Player preparing too long Android 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