- Home /
Question by
sirgarth13 · Dec 03, 2013 at 07:56 PM ·
c#materialtextmeshdynamically
Unity Meshes for C# generated objects
Hi I was wondering if anyone could help me with a problem I've got involving generating 3D text using C# script
included in the class definition
textM.name = inTarget.Name;
textM.AddComponent(typeof(TextMesh));
Defined within the constructor
text = (TextMesh)textM.GetComponent(typeof(TextMesh));
newMat = (Material)Resources.Load(@"material.mat", typeof(Material));
text.renderer.material = newMat;
No matter what material I use or how I seem to load it the text appears pink (as well as any primitives which use the same material)
Thank you for your time in advance,
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613123334im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I access built in shaders and fonts? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
C# how to change material's color using if 1 Answer
How do you set a material in c# script? 2 Answers