Home > Net >  Can't change TextMeshPro's alpha in canvas gruoup (Unity)
Can't change TextMeshPro's alpha in canvas gruoup (Unity)

Time:06-21

I've been trying to change the alpha value of an object and all of its children with a canvas group in Unity (I'm making UI animations), and every child will fade out, except for TextMeshPro objects. Why is that, and is there a way to make it work?

image of the editor showing the alpha value at zero

In this case, I've changed backgroundImage's Canvas Group alpha to zero, but as you can see al of its TextMeshPro children are still visible. I can't change their value individually, because some of them are instantiated at runtime.
I've also tried this but it didn't seem to work out.

CodePudding user response:

It seems that you are using TextMeshPro script instead of TextMeshProUGUI. CanvasGroup will not work with TextMeshPro variant as it is supposed to be used in the 3d world space, not canvas.

  • Related