3D Text, available since v 1.5 beta 2 (?), seems to be rendered in front of the other elements in the scene. Is this intended?
The default text uses GUI->Text Shader, which always renders in front of everything else. Create a new font material and give it a different shader to fix this. For what it's worth, it's always been possible to make 3D text, providing you assemble the object manually. Check out Component->Mesh->Text Mesh on the menu.
I just played with Text Mesh and got it nicely showing my text and setting it from a script. But then I wanted to assign a collider to it (ultimately to try to create something like a selection). I cant get a raycast to hit the text mesh... Do I need to assign a mesh to the collider? and How do I do that with a Text Mesh?
I don't think you can. I bet the best way would be to caculate how wide the string is and that make a box collider that fits to that size every frame. Hard, but possible.
Thanks for your reply, Neil. If I do as you propose, I get a black font (given that I use a alpha shader) that can not be seen from the back, and I can not change its color to anything but black. Ideas?
I figured it out! Based on a shader sample from the UnifyWiki, I hacked together a new shader that enables Text Meshes to have - Colors - Backfaces - Alpha - Z-sorting Code (csharp): Shader "ShiftControl/Colored 3DText Shader" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _MainTex ("Font Texture", 2D) = "white" {} } SubShader { Lighting Off cull off ztest never Zwrite off Fog { Mode Off } Tags {"Queue" = "Transparent" } Pass { Blend SrcAlpha OneMinusSrcAlpha SetTexture [_MainTex] { constantColor [_Color] Combine constant * constant, texture } } } } As this is my first shader, ever, I guess it has room for some improvement. Anyone?
this is kinda dead but there isn't a lot of info on 3DText... but can anyone pls explain me a bit on how to switch fonts with 3DText? Code (csharp): IEnumerator ChangeFont() { int i= fontRange; while(true) { yield return new WaitForSeconds(0.3f); Debug.Log(i); style.font = fonts[i]; bartext.font = style.font; bartext.material = fontMaterial[i]; // bartext.text = btext; text3D.font = style.font; text3D.renderer.material = fontMaterial[i]; text3D.text = btext; i++; if(i == fontRange+2) { i = fontRange; } } } this loops true the fonts and as you can see sets the Font and the Material. it works with GUI Text but doesn't seem to work with 3D Text. does anyone know why??