Search code examples
unity-game-enginepackageassembly-references

Unity : namespace TMPro not found


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 !


Solution

  • 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/