Update: version 2.2.1 out now!
If you’ve ever wanted real 3D text in Unity, now’s your chance…create text instantly from TrueType fonts, either dynamically at runtime or as prefabs. Works with Unity free and Pro, any language, should work on any platform. Comes as a .dll, plus source code is included. Get it on my website here! Also available on the Unity Asset Store!
Text can be created as a single object, or as separate GameObjects for each character. No tediously importing static text models from 3D apps; instead it’s as easy as this:
var text3D = FlyingText.GetObject ("Hello!");
Or you can use the inspector utility to create text objects directly in the scene. You get lots of control over appearance, such as resolution, color, size, extrusion depth, spacing, and so on. You can use HTML-like tags to change fonts, size, etc. in a single line of text, or set up defaults in the inspector. For example:
That was made with this text:
<font=Airstream><color=#5a7ae3><depth=.01><size=3>Flying
<color=#e0e0e0>
<depth=.2><font=Arial Black><size=1.5><space=.2>Text<depth=.75><zpos=-.25>3D
You can use any material, and textures can be per-letter, or stretched over the entire text. The resulting GameObject can be animated and otherwise manipulated like any other GameObject.
You can automatically add colliders and rigidbodies, which is especially effective for text as individual characters:
It comes with a nifty custom inspector:
(As you can see from that, you have to rename .ttf files as .bytes instead in order for them to work with FlyingText3D. You can do this outside of Unity, or use the inspector utility shown above. I wasn’t able to find a way around that, since there’s no access to the raw data of Font assets. If someone can think of a better work-around, let me know! Yeah, it’s a minor thing, but I’d still rather avoid it if possible.)
And, of course, it has complete documentation. While it’s pretty capable already, it’s just the 1.0 release, so there’s more to come:
• Add compound glyph support; currently simple glyphs work (which is what most characters are, but accented characters may or may not work, depending on the font).
• Add better non-Western font support; pretty much it just does left-to-right at the moment. I’m not too familiar with this area, so if you have a font in mind that doesn’t work right, it would be very helpful if you could send me a bit of text along with an illustration of how you would expect it to look.
• Have the ability to set a smoothing angle for extruded edges, which right now are always hard-edged.
• A utility for “baking” selected characters in the font, so the entire TrueType font file doesn’t have to be included. A lot of fonts are quite small anyway, but this could be especially useful for Asian fonts, which tend to be >10MB. Also this would allow you to include fonts where you don’t have a license to distribute the actual font, since it couldn’t be reconstructed, though you’d still be able to change size, etc. (but the mesh resolution would be fixed).
• Beveling, in addition to extrusion.
• Possibly additional kerning and character mapping tables, if you find any fonts that aren’t supported (though some fonts don’t have any kerning info at all anyway).
• Maybe some additional HTML-like tags?
• Other stuff you think of that would be cool.
Happy 3D-texting!
–Eric