- Home /
Assigning font material to 3d text
Dear Guys,
Please help me. I am creating a switch to change 3d text font type. For some bloody reason the below code changes the font type, but does not align the font material, thus the created text is unreadable. The weirdest thing is that if running in editor I manually set the mesh renderer/material once, everything is working properly afterwards. What do I do wrong? As always, any help is welcome and thanked in advance:
switch (newSelectedItemIndex){
case 0:;
(GameObject.Find(GameObject.Find ("SelectedObject").guiText.text).GetComponent("TextMesh") as TextMesh).font=Resources.Load("arial") as Font;
(GameObject.Find(GameObject.Find ("SelectedObject").guiText.text).GetComponent("TextMesh") as TextMesh).font.material=FontMats[0];
break;
case 1:;
(GameObject.Find(GameObject.Find ("SelectedObject").guiText.text).GetComponent("TextMesh") as TextMesh).font=Resources.Load("BLUEBOLD") as Font;
(GameObject.Find(GameObject.Find ("SelectedObject").guiText.text).GetComponent("TextMesh") as TextMesh).font.material=FontMats[1];
break;
Comment
Your answer
Follow this Question
Related Questions
3D Text not changing font 1 Answer
3D Text Font performance 0 Answers
SOLVED - 3D Text - How to apply new font type in Runtime 2 Answers
3d text with z axis depth 1 Answer