I thought it might be fun to create text out of voxels (cubes) and give them physics so the user can interact with it; and guess what? It was!
The first attempt
Shoot to start
At first all I wanted was a message to start my wave shooter game that said “Shoot to start”. As the game was in a retro 80s arcade style, I thought making the text out of 3D pixels (or ‘voxels’) might be kinda cool, so I started laying out tiny cubes to spell the phrase, gave them each a box collider and a rigid body, and then turned off their gravity.
I then hooked the text up to the script that starts the game and set their gravity to switch on when the player shoots.
Round 2
Getting carried away
But what if I want to change the text later, or use this somewhere else? I don’t want to have to hand-build every letter each time! …I know, I’ll just create an elaborate script that builds the letters for me based on any phrase I input into a text field!
Okay, so it turns out to create every letter by code involves a lot of work and, although it would be much nicer, and cleaner, to wrap this all up in a single script, it would be a thousand times quicker to hand-build every letter as individual assets [prefabs] and then place them in sequence, based on the sequence of characters in the text field.



