• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
Question by DocMcShot · Jul 12, 2018 at 11:00 PM · uitextfont

Did the Text Mesh Pro namespace change?

I updated a project to 2018.2 and when I did, I got the duplicate Text Mesh Pro errors that everyone has been asking about. I followed the instructions and it fixed that problem. I'm now experiencing a problem with the references I had in script to the TextMeshProUGUI components. My "using TMPro;" directive says it's not necessary and shows as an error. All I want to do is be able to modify the TextMeshProUGUI components via script. Did something change? Any help is appreciated.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Skelly1983 · Jul 13, 2018 at 04:07 PM

The namespace is correct.

for instance to change the text all you would need is the following:

 using TMPro;
 using UnityEngine;
 
 public class ClassName : MonoBehaviour
 {
     private TextMeshProUGUI textMeshProUGUI;
 
     private void Start()
     {
         textMeshProUGUI = GetComponent<TextMeshProUGUI>();
         
         textMeshProUGUI.text = "New text";
     }
 }


Hope this helps.

Comment
Jalechah
Lohaz
pgrzmil
Nadir_Alishly
kuziva
marck_ozz

People who like this

6 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image danam · Jan 28, 2022 at 12:28 AM 0
Share

this does not work

avatar image

Answer by DocMcShot · Jul 17, 2018 at 12:30 AM

So I solved my own problem. I went to the TextMesh Pro option window in the editor (Window->TeshMesh Pro), and imported the "TMP Examples and Extras." I had already imported the Essentials, but apparently, there's something missing from essentials that stops Visual Studio from recognizing the namespace. Anyway, I didn't include the example scenes on my import and it still worked. Hope this helps other. I'm sure it will get fixed eventually :).

Comment
Hbombe
Jalechah
ff63gf
ROBYER1
peterpan2022

People who like this

5 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by insominx · Feb 19, 2020 at 12:30 AM

Another reason this might not work is if the assembly you're working in does not reference the TextMeshPro one. The image below shows what a valid reference might look like:

Comment
hernan-cl
JacobRGames

People who like this

2 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Petrit24 · Apr 16, 2020 at 06:41 PM 2
Share

Where is this screenshot from? Like where can I find this

avatar image

Answer by hernan-cl · May 26, 2020 at 01:06 AM

This solution worked for me: https://forum.unity.com/threads/namespace-tmpro-not-found-in-test-runner-test.541387/#post-3570214 Pasting here: The step that I missed which is causing the issue is related to the use of an Assembly Definition in this created test folder.

The solution is to manually edit the .asmdef to add a reference to the Unity.TextMeshPro assembly.

In order to do so, select the file and use the context menu "Show in Explorer" and then open the file in some text editor to make the following changes..

 {
     "name": "Tests",
     "references": [ "Unity.TextMeshPro" ],
     "optionalUnityReferences": [ "TestAssemblies" ]
 }
  
Comment
ROBYER1

People who like this

1 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by warrenSOLID · Jun 01, 2021 at 07:26 PM

btw, this answer set totally derailed me. When i googled "unity TextMEshPro text" the top result was (is) some old digital natives tutorial which references an old way to handle this. http://digitalnativestudios.com/textmeshpro/docs/ScriptReference/TextMeshPro-SetText.html

basically the old way was "TextMeshPro" but the new way is "TextMeshProUGUI"

(this is in Skelly's top rated answer here. but i didn't read that far. instead i got down into all this assembly definition stuff which wasa misssstakeeeeeee.)

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

213 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Text font and bold tag issue 0 Answers

TextMeshPro Set Alpha Color 0 Answers

How To Load TTF Font From External File 0 Answers

UI Text rich formatting broken after upgrading to 5.2 1 Answer

Load font by script 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges