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 Pro TextMesh Pro Object Not appearing in game view

Discussion in 'UGUI & TextMesh Pro' started by Protexxi, Nov 20, 2019.

  1. Protexxi

    Protexxi

    Joined:
    Oct 4, 2019
    Posts:
    7
    Hi all,

    I'm having an issue with the TextMesh Pro Text, I have a TextMeshPro Component in my scene with some test text in for now.

    I also have the following script locating the component and changing the text.(located in a different game object)

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5. using TMPro;
    6.  
    7. public class Clicked : MonoBehaviour
    8. {
    9.     public TextMeshPro ClickCounter;
    10.  
    11.  
    12.     // Start is called before the first frame update
    13.     void Start()
    14.     {
    15.         GameObject counter = GameObject.Find("ClickCount");
    16.         ClickCounter = counter.GetComponent<TextMeshPro>();
    17.         //ClickCounter.SetText("IT WORKED");
    18.     }
    19.  
    20. }
    21.  
    in the inspector the text changes

    but the text its self isn't showing in the game window.

    iv googled and found a number of forums and post about two different types of text mesh?
    TexteshPro and TextMeshProUGUI.
    but i cant seem to get my head around it as i only discovered text mesh pro about 10 minutes ago
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See the following post which provides details on the two TMP components.