- Home /
Question by
RKaffer · Nov 06, 2019 at 10:51 AM ·
scripting problemtext mesh
How to edit Text Mesh Pro face dilate through script
I'm trying to make my menu more dynamic and want the options to fade in and out on click by dilating the face of the text with text mesh pro, but cant figure out how to edit that through script. Help would be appreciated, thanks!
Comment
Best Answer
Answer by TreyH · Nov 06, 2019 at 12:08 PM
According to this forum post, the dilate effect can be adjusted through a shader property on its font material. As an example:
public TextMeshProUGUI tmp;
void Start()
{
this.tmp.fontMaterial.SetFloat(ShaderUtilities.ID_FaceDilate, 0.5f);
}
where the ShaderUtilities class has a convenient shader property ID there already.
Thank you so much, it works. I saw that post previously but did not know that you needed to use specifically Text$$anonymous$$eshProUGUI to access it. Thanks a bunch!