Using TextMeshPro
To make a billboard glow like a neon sign, you can use TextMesh Pro which presently comes included free with Unity. For instance:
- With
ScoreBoard
selected in Hierarchy, create a newTextMesh
text element (right-clickUI
|TextMeshPro - Text
). - This replaces our standard UI text element, so disable the
Text
object. - On the TMP text, set its
Font Asset
toBangers SDF.
- For its
Material Preset
, useBangers SDF Glow.
- Scroll to
Glow
settings to adjust the colors and other settings as you desire.
You can even write a script that cyclically modifies the glow settings to make a flashing, glowing sign!
If you choose to try this, be sure to update the GameController's KillTarget
script to use the TMP object rather than the UI one. Modify KillTarget.cs
as follows:
We may be using the UnityEngine TextMesh Pro classes:
using TMP;
Replace the data type of the scoreText
variable with TMP_Text
:
public TMP_Text scoreText;
Drag the TMP text item onto the slot in the Inspector. The rest of the script...