- Home /
3D Text Losing Font After Destroy
I have been developing a tool-tip system for my game that enables me to either make use of the GUI tool-tips or a custom prefab tool-tip that can be anchored to various positions around a desired icon.
The problem I am having is that for some reason when I test the game I have to re-assign the font to the TextMesh after every run. I am making sure to apply changes to my prefab and am not re-assigning the font at runtime.
Does anyone know why the 3D text loses association with it's font when the game is stopped?
You're destroying the instance of the prefab at runtime, not the prefab itself right ?
I think I was assigning a new material to the prefab ins$$anonymous$$d of the instance, fixed it now. Careless mistake, spotted it straight away with a fresh $$anonymous$$dset this morning. Thanks for your help. :).
Answer by Tsumik1 · Jan 29, 2013 at 10:17 AM
I made a rather stupid mistake with assigning the material to the wrong instance of TextMesh.
Caught it straight away this morning when working with a fresh mind.
Answer by Sanky · Jan 28, 2013 at 04:45 PM
don't destroy text object, use mesh render for enable disable to object it will help you renderer.material=enable;
I tried that, didn't solve the issue, however cleaning up my code I spotted that I forgot to store the generated material after creation so it seemed as though the font and color were lost. Thanks for the suggestion.
Your answer
![](https://koobas.hobune.stream/wayback/20220613091734im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Strange Error: Shader wants normals, but the mesh doesn't have them 3 Answers
Text map problem with 3d text 1 Answer
How to find a font via script? 2 Answers
3D Text Mesh produces wrong letters 1 Answer
Cant change color of 3dText/Text Mesh 3 Answers