I'm working on a bit of UI for a small game we are making at university and i'm having an issue finding a way to animate text the way i want.
So basically i want to have text with varied color brightness, which gives the effect of moving in a constant speed in one direction.
I have seen this done in Unreal Engine on materials by making the texture on the object scroll but have yet to find something similar in Unity. Moreover i want to do this on strings of text which seem to use a different type of material.
It is an effect very similar to the classic matrix moving text except in this case i would like to have the text stay immobile and just the pixels brightness vary in strength.
Replies
With TextMeshPro, there would be a few ways of doing this.
The simplest way I can think of is to use TextMeshPro's rich text tags to programatically change the text color per character. From what I recall however there may be a performance cost to this but I can't quite say if it would be a high impact cost.
Come to think of it, this would also probably work with Unity's own rich text tags. But TMP has much better font rendering. Use TMP!
The more complicated but possibly more performant way to do this with TMP is to modify the vertex color of each character with a script. There are example scripts that come with TMP that show how to do this. But doing this might be pre-emptive optimization, so try out the performance with the rich text tags first.