• 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
1
Question by afromofu · Jul 25, 2012 at 07:31 AM · androidguitexttextmesh3dtext

3D Text (TextMesh) not updated/redrawn every frame (android only)

Hi.

When I try to change a TextMesh's text every frame on Android, the text that is displayed on the scene is sometimes not refreshed (redrawn?). Does anyone know why, and know a solution to this?

Conditions:

  • This doesn't happen on PC. (I did not test on iPhone)

  • textMesh.text correctly returns the text that should be displayed. (it's just not drawn)

  • This doesn't happen with GUIText.

Smallest sample project: Uploaded here.

This is just a simple scene with a camera, a 3D Text and a GUIText. When you touch the screen, the text is changed each frame during the next 10 frames.

  • On Android: the text is correctly displayed for GUI text, but not for 3DText.

  • On PC: no problem for both.

This is the script used to update both texts:

 using UnityEngine;
 using System.Collections;
 
 public class NewBehaviourScript
  : MonoBehaviour
 {
  int _currentVal;
  int _targetVal;
  
  void Start ()
  {
  _currentVal = 0;
  _targetVal = 0;
  }
  
  bool _HasTouched()
  {
 
 #if UNITY_EDITOR
  return Input.GetMouseButtonDown(0);
 #else
  if (Input.touchCount == 0)
  return false;
  TouchPhase phase = Input.GetTouch(0).phase;
  return phase == TouchPhase.Began;
 #endif
  
  }
  
  // Update is called once per frame
  void Update()
  {
  if (_HasTouched())
  _targetVal += 10;
  
  if (_currentVal < _targetVal)
  _currentVal++;
 
  TextMesh textMesh = gameObject.GetComponent<TextMesh>();
  if (textMesh != null)
  textMesh.text = _currentVal.ToString() + "%";
  GUIText guiText = gameObject.GetComponent<GUIText>();
  if (guiText != null)
  guiText.text = _currentVal.ToString() + "%";
  }
 }


textmeshissue.zip (242.1 kB)
Comment
Add comment · Show 3
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 afromofu · Jul 26, 2012 at 01:28 AM 0
Share

Posted it on Feedback as it seems to be a bug for me

http://feedback.unity3d.com/unity/all-categories/1/hot/active/textmesh-not-updated-bug-or-

avatar image Eric5h5 · Jul 26, 2012 at 02:42 AM 0
Share

Unity Feedback is for feature requests, not bug reports. Use the bug reporter for that.

avatar image afromofu · Jul 26, 2012 at 03:36 AM 0
Share

I didn't know we could report bugs. Thanks for the information Eric5h5.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to draw 3D text from code 4 Answers

Insert 3d text to the front face of a cube GameObject 0 Answers

Android: How do you position GUITexture and GUIText according to different screen sizes (JS)? 2 Answers

3DText with outline 0 Answers

3D Text font issue 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges