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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Text mesh pro

Discussion in 'Scripting' started by raucescucosmin, Mar 28, 2020.

  1. raucescucosmin

    raucescucosmin

    Joined:
    Aug 7, 2018
    Posts:
    5
    Hey can someone help me with a problem I'm using for the first time for a tic tac toe game text mesh pro but I don't know why it keep show Text Mesh pro couldn't be found, how can I fix it?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,971
    Did you import TextMeshPro package?
     
  3. raucescucosmin

    raucescucosmin

    Joined:
    Aug 7, 2018
    Posts:
    5
    Yup I even unistall it and install it again
     
  4. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,151
    Once you add it through the package manager, it should prompt you to add the essential parts. Make sure you do that as well. If you've done both of those, when you try to use it in a script you need to add the proper using statement.

    using TMPro;
     
  5. raucescucosmin

    raucescucosmin

    Joined:
    Aug 7, 2018
    Posts:
    5
    This is the code that i'm using

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    using TMPro;

    public class GridSpace : MonoBehaviour
    {

    public Button myButton;
    public TextMeMeshProGUI buttonText;
    public string playerSide;

    private void Start()
    {
    myButton = GetComponent<Button>();
    buttonText = GetComponentInChildren<TextMeMeshProGUI>();
    }

    public void SetSpace()
    {
    buttonText.text = playerSide;
    myButton.interactable = false;
    }

    }
     
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,454
    TextMeMesh?
     
    Kurt-Dekker likes this.
  7. raucescucosmin

    raucescucosmin

    Joined:
    Aug 7, 2018
    Posts:
    5
    I saw in a video, i am a beginner so i said Hmm let's watch some tutorials and i saw that so i said is correct
     
  8. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,151
    It's TextMeshProUGUI
     
  9. raucescucosmin

    raucescucosmin

    Joined:
    Aug 7, 2018
    Posts:
    5
    Thank you so much it works
     
  10. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,971
    Excellent. Anytime you see identifiers like TextMeMeshProUGUI come up with a red squiggle, this should be your initial checklist:

    1. did I spell it right (go look in the docs, copy/paste to be sure)
    2. did I add the necessary
    using
    statement? (again, docs)
    3. is this even the right thing for this langauge?
    etc