Animator causing textMeshPro assets to disappear on build. Anyone else seen this weirdness?

this has happened to me twice now and I still don’t get it. Everything will look fine in Unity, but when I make a build, my TMPro assets either don’t show up at all or show up as barcode looking things. I have checked all my font textures and everything, and that all checks out. No errors or anything. My UI TMPros have a different texture in every related field than the non-UI ones.

Last time it happened I spent all day trying to figure it out, and the best test I found online was to rebuild the scene piece by piece until it stops working. It happened again yesterday, and in both instances, there was an object with an animator that for some unknown reason, did not like having an animator on it.

In both cases the objects were nowhere near any TMPro assets. Just normal objects with a sprite renderer and an animator. But deleting the Animator component makes the text in the build show up. So I can get rid of the animator and rebuild it, put it on another object like a child object, and it works fine. But if THAT animator is on THAT specific object, my text is gone.

Does anyone have any insight they can share as to why this happens? It’s very frustrating and difficult to test. My game scene is huge and narrowing it down takes hours.

Thanks!

Go check out your animations closely… make sure you NEVER set any of the x, y, or z values for scale (ANY of the scales anywhere in the hierarchy!) to zero.

When scale reaches zero in X and Y, bad things happen to the layout computations (divide by zero errors).

When scale reaches zero in the Z direction, bad things happen to the SDF font glyph rendering shader.

I’m guessing one of your animations has a scale reach / touch zero.

Don’t set scales negative generally either.