Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

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,246
    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:
    1
    ay this worked fine (if you have the TextMeshPro packages that is)
    thanks alot!!