Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

TextMesh in WebGL

$
0
0
I am meeting an issue when using TextMesh and displaying it on a WebGL build. I got a NullReferenceException and the error message below: Can't add component because '' is not derived from Component. However, the text displays properly on the Game view in Unity. Below is how I created the text object via code. GameObject textObject = new GameObject (); textObject.AddComponent (); textObject.GetComponent ().text = text; textObject.GetComponent ().color = fontColor; textObject.transform.parent = parentObject.transform; Note that I am using 'Screen Space - Camera' on my Canvas, and parentObject is in canvas. Will appreciate advice. Thanks!

Viewing all articles
Browse latest Browse all 2390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>