Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to programmatically activate the Glow option in a Text Mesh Pro font

Discussion in 'UGUI & TextMesh Pro' started by literacy, Aug 10, 2022.

  1. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    I can activate the Glow setting for a Font in Text Mesh Pro by checking the Glow checkbox:

    Glow on.png

    Is there a way I can programmatically do the same thing? I looked in the corresponding shader, and found what I think is the name of the variable: GLOW_ON. But when I tried to set that variable to 1 using Material Set Float and Set Int, neither one worked. Either I have the wrong variable name, or I'm not setting it the proper way.

    Any suggestions on how to programmatically activate the Glow option in a Text Mesh Pro font?
     
  2. literacy

    literacy

    Joined:
    Nov 14, 2021
    Posts:
    56
    Just to loop back... I ended up using the Material.EnableKeyword (and DisableKeyword):

    material.EnableKeyword("GLOW_ON");
    material.DisableKeyword("GLOW_ON");