TMP UI text disappearing in AR when re-parented to world-space canvas

Hi, quick one that I can’t fix myself.

I have an Screenspace canvas object that I re-parent to a world-space canvas attached to an ARprefab.

All the UI child images appear fine and at the correct scale, but the TMP assets have all become invisible (they trace out in the correct positions though)

Any TMP assets already on the AR prefab are fine though.

Has anyone else had this issue ?

I’m on 2019.3.1 but I’ve had this issue with other versions of Unity too . Never found a fix, just fancied sorting it out this time around :slight_smile:

I’ve narrowed it down to … Any TMPtext that gets re-parented to a canvas attached to an AR prefab displays fine, until you access it’s recttransform - and then POOF it becomes invisible :open_mouth:

Would love a fix for this if anyone has it.

Can you please submit a bug report with the included project for me to take a look at?

Not sure why accessing the RectTransform would go POOF. When it does that, are the values of the RectTransform changes somehow? Maybe Anchor or Z?

thanks for the response Stephan,

I’ve built another font asset and integrated that and it DOES display (yay) - but only as white rects (boo)

I’ve looked up the forum posts on this and checked to see if the local scale is uniform (it is) and tried calling ForceMeshUpdate() on the text but it doesn’t fix it.

I’ve looked up your responses here - There seems to be an issue with GetPreferredValues and Word Wrapping - and will try some of the approached mentioned here and see how they go.

Is there any more obvious method I should be using ?

thanks,

If you are able to reliably reproduce this behavior, please submit a bug report with project and steps to reproduce. This will make it easier for me to figure out what is going on and resolve the issue for you.

White Blocks are indicative of the SDF scale being which happens when the scale of the text object might be zero at some point.

Seems like whatever is going on when you parent the object, results in the scale of the text object being zero at some point.

ok. bug and enormous project sent !
I also tried upgrading TMP to 2.1 and also trying some variations on the shaders but still no dice.

Thank you.

Please provide me with the Case # once you have it. This will make it easier for me to find the bug report.

Hi Stephan - it’s Case 1263129
It’s a bit of a pain to re-create because it’s using AR Foundation - sorry.

Hi Stephan again - my PC locked up which that project was getting uploaded and it’s submitted the bug twice ! - so it’s both Case 1263043 AND 1263129 - arrgh.

I am circling back thru bug reports and looking at your case. First, are you still having the issue?

If you are, in the latest version of the TMP package, which is version 2.1.1 for Unity 2019.x, the TMP Essential Resources have been updated to include new shaders with the suffix SSD as seen in the image below.

6268344--692022--upload_2020-9-1_17-8-11.png

These new shaders handle SDFScale differently and as such, if your issue was SDF Scale related, using the mobile SSD version would resolve your issue. Let me know if using this new shader resolves the issue.

I am still looking into the original issue to figure out why the SDF Scale is incorrect (potentially) but need to get an Android device that support ARCore as mine does not support it.