Lerp font size, smoothly.

Hi,

Is it possible to smoothly lerp a font size? Or can a font only be resized in increments of 1?

This is what I have, the score pops out then returns back slower, but noticed the font only increases by 1 not anything smaller giving it a slightly jerky look, is there a better way?

function lerpScore(){
	
	    j = 0.0;
// the last number below is seconds to lerp
		rate = 1.0/0.2;
		while (j < 1.0) {
			j += Time.deltaTime * rate;
			TextStyle.fontSize = Mathf.Lerp(30, 80, j);
			yield; 
		}
	    j = 0.0;
// the last number below is seconds to lerp
		rate = 1.0/1.0;
		while (j < 1.0) {
			j += Time.deltaTime * rate;
			TextStyle.fontSize = Mathf.Lerp(80, 30, j);
			yield; 
		}

Yes, a font can only be resized in increments of 1. If you look it up, it’s simpler than that – font size is an integer.

In C# that would be obvious – you’d get a “can’t assign float to int” error. The UnityScript you have is “fixing” the error by rounding down.

For a smooth size change, and this is a very different set-up, can use a 3Dtext and change characterSize (or just localScale.)