on-internet
← Community

How to autosize text on a textmesh

Stack Overflow ·

How do you auto-size text on a textmesh. I have dice, with six sides, that I want to put words on. The words will constantly be changing, so I need them to auto size based on the size of the cube, which doesn't change. The dice are not UI elements and thus sit outside the canvas. Here is how I am adding the text. LocationSide1.GetComponent<TextMesh>().text = "1"; LocationSide2.GetComponent<TextMesh>().text = "2"; LocationSide3.GetComponent<TextMesh>().text = "3"; LocationSide4.GetComponent<TextMesh>().text = "4"; LocationSide5.GetComponent<TextMesh>().text = "5"; LocationSide6.GetComponent<Tex

Comments

Sign in or sign up to comment and upvote.

No comments yet.