- Home /
TextMesh Dispaly Bug,TextMesh Error Unity 2017.4.0.f1
When I first set text value, it will display correctly in game scene, but when I change the value dynamically, it just show half of it.
protected void GenerateTextMesh()
{
GameObject textobject= new GameObject();
textobject.transform.parent = transform;
textobject.transform.localPosition = new Vector3(0.5f, 3.5f, 0.0f);
textobject.transform.rotation = Quaternion.Euler(0, 180, 0);
m_TextMesh = textobject.AddComponent<TextMesh>() as TextMesh;
m_TextMesh.text = "None / None";
m_TextMesh.fontSize = 10;
m_TextMesh.characterSize = 0.2f;
}
protected void UpdateTextMesh(string text, string action)
{
if (m_TextMesh != null)
{
if (text.Equals(string.Empty))
text= "None";
if (action.Equals(string.Empty))
action = "None";
m_TextMesh.text = text+ "/" + action;
}
}
,When I change TextMesh text dynamicly, it just show half of them, not show entirely. But when first time set the text, it shows entirely....
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612162942im_/https://answers.unity.com/themes/thub/images/avi.jpg)