Answers for "create a text with code unity TMP"

C#
0

how to change textMesh Pro unity

// If you are trying to chnage the text on a TextMeshPro:
  
public TextMeshPro TextMeshProObject;
//you shouldnt need to get component the editor should take care of this for you when 
//you drop it since you have the object set to TextMeshPro and not just GameObject
TextMeshProObject = GetComponent<TextMeshPro>();
TextMeshProObject.text = "Hello";

// If you are trying to change the text from a gameobject:
TextMeshProUGUI TextMeshProLable = YourGameObject.GetComponent<TextMeshProUGUI>();
TextMeshProLable.text = "Your Text"
Posted by: Guest on October-30-2020
2

unity change tmp text from script

using UnityEngine.UI;
using TMPro;

void Update()
{
    TextMeshPro lemonsss = GetComponent<TextMeshPro>();
}
Posted by: Guest on August-04-2020

C# Answers by Framework

Browse Popular Code Answers by Language