Skip to content

A small script that renders text in Unity with single letter gameobjects

Notifications You must be signed in to change notification settings

isenmann/UnityTextGenerator

Repository files navigation

UnityTextGenerator

alt-text

Writing text in Unity isn't that easy, at least if you want to generate text with single gameobjects. Every single letter is it's own gameobject and so you have to drag and drop every single letter to its place. Personally I was frustrated and didn't find a solution on the internet, so I decided to write this small script which generates text in the editor while you are typing as you can see in the animation. I used the letters from the Unity Asset Store package "Simple Icons" (https://www.assetstore.unity3d.com/en/#!/content/59925)

Usage

Create an empty gameobject (TextToVisualize) and attach the TextGenerator script to it. Generate a second empty gameobject (TextObjects) and add all the letters and numbers as children to it. Make sure that your letters and numbers gameobjects have BoxCollider attached. Like you see in the screenshot:

alt-text

Set "Available Letters" in the script to the TextObjects gameobject: alt-text

If the letters have some prefix or postfix in their name, then you have to set it in the script, too. The script is just looking for the letter itself in the name. So if you press an "A", then the script is looking for the "prefix + A + postfix" in the name of the gameobject.

alt-text

Hints

If you change anything on the entered text, the script will delete all the letters and rendered all letters again. The script can be disabled after the usage, so it's not executed during runtime.

About

A small script that renders text in Unity with single letter gameobjects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages