Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

removing unnecessary canvas renderer component from text object

Discussion in 'Editor & General Support' started by radiantboy, Dec 24, 2019.

  1. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,592
    Im suddenly seeing this message from TMPro_Priviate.cs (textmeshpro3.0.0) "removing unnecessary canvas renderer component from text object" followed by this error, "can't remove canvasrenderer because textMeshpro depends on it".

    Anyone know how I stop this? Obviously I tried removing the canvas renderer but then a popup says
    "can't remove canvasrenderer because textMeshpro depends on it" etc..

    so it this a bug in tmpro? or a mistake ive made? It only started happening when i went to a newer unity alpha then rolled back.. presumably due to a newer version of textmeshpro?
     
  2. kmedved

    kmedved

    Joined:
    Aug 18, 2016
    Posts:
    187
    TextMeshProUGUI for Canvas using CanvasRenderer. You can't delete it, because TextMeshProUGUI require it.
     
  3. n8burba

    n8burba

    Joined:
    Feb 4, 2013
    Posts:
    11
    Roll back to 2.0.0 to fix the issue.
     
  4. ETGgames

    ETGgames

    Joined:
    Jul 10, 2015
    Posts:
    88
    It debug logs 'Removing unnecessary CanvasRenderer component from text object.' But I cannot remove the canvasrenderer from my tmp ui objects! What do I do...

    UPDATE: It was actually just normal tmp GOs, not ui ones. I guess back in the day when I added them it came with canvas renderer by default
     
    Last edited: Jul 23, 2020
  5. Hoorza

    Hoorza

    Joined:
    May 8, 2016
    Posts:
    40
    Same here, my prefab to display damage in the scene had Canvas Renderer on it, I guess it came with TMPro by default. Removed the Canvas Renderer from the prefab and the message is gone. Everything else seems to be working as intended.
     
  6. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    323
    So I get this problem on a prefab that has a TextMeshPro - Text object on it but not Canvas Renderer. I looked at the prefab and there is no Canvas Rendrer on it. But there are hundreds in the scene. It's so annoying. Any ideas on why this is happening with TextMeshPro - Text components?
     
  7. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    Is there a Mesh Renderer on it? I seem to be getting the message when there's a TextMeshPro - Text and a mesh renderer.

    Edit to add the following:

    Now this is odd. When I look at my game object prefab it only contains the components Rect Transform, Mesh Renderer, and TextMeshPro - Text.

    But if I look inside the .prefab file it contains the mesh renderer, but also a canvas render at the end, even though that component doesn't show up in the inspector??


    Code (CSharp):
    1.  m_Component:
    2.   - component: {fileID: 22467808}  <-- RectTransform
    3.   - component: {fileID: 2335244}  <-- MeshRenderer
    4.   - component: {fileID: 3335244} <-- MeshFilter
    5.   - component: {fileID: 11435244} <-- TextMeshPro - Text
    6.   - component: {fileID: 22237362} <-- CanvasRenderer???
    7.  
    8. --- !u!222 &22237362
    9. CanvasRenderer:
    10.   m_ObjectHideFlags: 0
    11.   m_CorrespondingSourceObject: {fileID: 0}
    12.   m_PrefabInstance: {fileID: 0}
    13.   m_PrefabAsset: {fileID: 0}
    14.   m_GameObject: {fileID: 135244}
    15.   m_CullTransparentMesh: 0
    I made a backup and removed the canvas renderer reference. The messages went away and everything works fine. No idea why it was there or why it didn't display.
     
    Last edited: Oct 22, 2020
  8. NoDumbQuestion

    NoDumbQuestion

    Joined:
    Nov 10, 2017
    Posts:
    186
    To hide warning when upgrade project to newer textmeshpro version.

    Drag all TextMeshPro prefab to any scene. It will call awake function to upgrade prefab.

    The prefab will say it have changed component which remove old canvas renderer.
     
    onopko123 and Dave-Carlile like this.
  9. onopko123

    onopko123

    Joined:
    Jun 9, 2020
    Posts:
    5
    Thank you!