I work for a company that is basically creating an engine using Unity…
One of the possible objects the user can use is a “Text Box”, which uses a TextMesh Pro to display text.
Recently, I added a change on it so we could see the colliders inside this engine we are building, so I have a Line Renderer on my Text Box object.
Problem is, whenever a call to change “TextMeshPro.font” is made, it searches through the object and finds the first Renderer, which is the LineRenderer I have to display colliders, and not the MeshRenderer that TextMeshPro is looking for.
Is there a way I can change TMP code or a hack I can use to set the MeshRenderer correctly, without messing my other objects?
Thanks!
(PS. Order of behaviors were changed to be usable for print, in the first panel the line renderer is above the mesh renderer. In the second one I manually change the errors)
Having two different renderers on the same object could potentially results in unforeseen issues. This is not something that I have tested.
Is the functionality provided by the Line Renderer for your use case only used in the Editor or is it used at Runtime?
For debugging purposes, there is the TMP_TextInfoDebugTool.cs script that is included in the TMP Examples & Extras. This script which can be added to a text object does draw bounds for characters, words, etc. Perhaps a similar implementation could be used instead of using a Line Renderer.
It is used at Runtime (well… Editor time of the finished engine is Runtime of Unity Engine)
I have just checked the file you talked about, but Gizmos would not work for me in this case… I am modifying the code so the LineRenderer will only be added to the object after the text label has been fully configured.
Thanks for the fast response