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

Issue with TextMesh Pro Import

Discussion in 'Scripting' started by peterfuj23, Jul 22, 2021.

  1. peterfuj23

    peterfuj23

    Joined:
    Jun 24, 2021
    Posts:
    1
    Hi,

    Fairly new to Unity and i've created a project to do some testing with and i've made a simple script to update a TextMesh Pro object from the MRTK toolkit but i've having issues just using the TMPro library on my script. Here is the start of my script:

    Code (CSharp):
    1. using TMPro;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.UI;
    6.  
    7.  
    8. public class TextDisplay: MonoBehaviour
    9. {
    10.  
    11.     TextMesh DisplayText;
    12.  
    13.     // Start is called before the first frame update
    14.     void Start()
    15.     {
    16. ............
    But that gives me the following error:
    Assets\Scripts\TextDisplay.cs(4,7): error CS0246: The type or namespace name 'TMPro' could not be found (are you missing a using directive or an assembly reference?)

    TextMesh Pro is a dependency on the MRTK package so was installed as you can see on the image attached.

    I'm at a bit of a loss to why it's not letting me use it. Anyone have any suggests on anything to try?

    Thanks.
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    First thing is to try just reimport all, since it smells like perhaps TMPro didn't get compiled properly.

    Also, just to be clear, this class
    TextMesh
    is NOT part of TMPro but rather the original legacy text mesh object from Unity.