Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh cannot show the text immediately when updating text

Discussion in 'AR/VR (XR) Discussion' started by hqthai01, Jan 18, 2015.

  1. hqthai01

    hqthai01

    Joined:
    Jan 6, 2015
    Posts:
    1
    Hello everyone.
    I got an error, and I don't know how to fix it. The error is that the text of the TextMesh cannot update immediately when I update that text in the code. But when I use Debug.Log I see the text is changed but it does not show immediately, when I change it to other value, it shows the previous text that I changed.
    Here is the sample code I got that errors.

    Code (CSharp):
    1.  public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
    2.     {
    3.        
    4.         GameObject newImageTarget = Instantiate (ImageTargetTemplate.gameObject) as GameObject;
    5.  
    6.         string metadata = targetSearchResult.MetaData;
    7.  
    8.         ImageTargetBehaviour imageTargetBehaviour = mImageTracker.TargetFinder.EnableTracking(targetSearchResult, newImageTarget) as ImageTargetBehaviour;
    9.  
    10.         user_info.text = metadata;//user_info is the text mesh that I get in Start() method
    11.         Debug.LogWarning ("text mesh: "+user_info.text);
    12.         Debug.LogWarning ("Metadata Value: " + metadata);
    13. }
    The code I use in my cloud recognition with vuforia extension.
     
  2. ekimelif213

    ekimelif213

    Joined:
    Feb 16, 2017
    Posts:
    1
    I have the same problem did you solve your problem?
    Please can you help me?
     
  3. anule3ka96

    anule3ka96

    Joined:
    Sep 12, 2018
    Posts:
    7
    Does anyone know how to solve this?