Search Unity

TextMeshProUGUI not found

Discussion in 'UGUI & TextMesh Pro' started by SmokeExotik, Nov 20, 2020.

  1. SmokeExotik

    SmokeExotik

    Joined:
    Nov 20, 2020
    Posts:
    1
    Error: 'TextMeshProUGUI' could not be found (are you missing a using directive or an assembly reference?)
    My code:
    public void Player1Scored()
    {
    Player1Score++;
    Player1Text.GetComponent<TextMeshProUGUI>().text = Player1Score.ToString();
    ResetPosition();
    }
    All it shows is TextMesh which I am not using and can't figure out how to use. Please help me fix this error, it's a game I'm making for me and my sister to play together.
     
  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,511
    First, try adding
    using TMPro;

    at the very top of the file where the other "using" statements are.

    If that doesn't work, on the top bar, go to Window >> Package Manager >> and find TextMeshPro and add it to your project if it is missing.

    By the way, this is the 2D forum. A question like this best fits in this forum for future reference:
    https://forum.unity.com/forums/ugui-textmesh-pro.60/
     
    Chicken_Master08 likes this.
  3. Chicken_Master08

    Chicken_Master08

    Joined:
    Dec 5, 2022
    Posts:
    2
    ay this worked fine (if you have the TextMeshPro packages that is)
    thanks alot!!