1

I have a little problem. Unity doens't recognize a namespace : TMPro. It's the name space that make us to use Text Mesh Pro component with scripts. However, It is not found only in files of a package downloaded on git : XCharts. I don't know how to resolve this... Can u help me ?

Thanks for answers !

derHugo
  • 83,094
  • 9
  • 75
  • 115
  • Have you installed TextMeshPro via the Package Manager for your project? And in case you are working with assemblies have you also referenced the according assembly in your assembly definition as dependency? – derHugo Jul 27 '21 at 14:46

2 Answers2

3

This error can occur in 3 different cases:

  • TextMesh Pro isn't imported (unlikely since it is imported by default): import TextMesh Pro from Package Manager
  • XCharts asset's Assembly Definition file isn't referencing TextMesh Pro: you need to select all Assembyl Definition files (.asmdef) inside XCharts folder and add TextMesh Pro to their Referenced Assemblies list (if XCharts was imported via Package Manager, you need to move it to Assets folder to modify its files)
  • Error doesn't show up in Unity console: it's an IDE intellisense issue: https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/
yasirkula
  • 591
  • 2
  • 8
  • 47
0

answer: it's plain busted. If you import (by name) com.unity.textmeshpro and then specify "3.2.0-pre.3", this will allow you to use "using TMPro". 3.0.6 is busted.

eric frazer
  • 1,492
  • 1
  • 12
  • 19