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

no 'CanvasRenderer' attached to the "Caret" game object

Discussion in 'UGUI & TextMesh Pro' started by actionjdjackson, Jul 31, 2020.

  1. actionjdjackson

    actionjdjackson

    Joined:
    Nov 24, 2018
    Posts:
    1
    MissingComponentException: There is no 'CanvasRenderer' attached to the "Caret" game object, but a script is trying to access it.
    You probably need to add a CanvasRenderer to the game object "Caret". Or your script needs to check if the component is attached before using it.
    UnityEngine.CanvasRenderer.EnableRectClipping (UnityEngine.Rect rect) (at <7e0e20f383154bcfa6b81aff2d09857f>:0)
    UnityEngine.UI.MaskableGraphic.SetClipRect (UnityEngine.Rect clipRect, System.Boolean validRect) (at /Applications/2020.1.0f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/MaskableGraphic.cs:145)
    UnityEngine.UI.RectMask2D.PerformClipping () (at /Applications/2020.1.0f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/RectMask2D.cs:245)
    UnityEngine.UI.ClipperRegistry.Cull () (at /Applications/2020.1.0f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Culling/ClipperRegistry.cs:46)
    UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at /Applications/2020.1.0f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:197)
    UnityEngine.Canvas.SendWillRenderCanvases () (at /Users/builduser/buildslave/unity/build/Modules/UI/ScriptBindings/UICanvas.bindings.cs:72)

    I try to play a scene with a TMP Input Field in it, and nothing appears and I get this error repeatedly. If I disable the GameObject holding the TMP Input Field, everything appears normally - but no Input Field, which I need. Any ideas?
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Make sure that you are using appropriate version of the TMP package for the version of Unity that you are using.

    The latest releases of the TMP package are:

    Version 1.5.1 for Unity 2018.4
    Version 2.1.1 for Unity 2019.4
    Version 3.0.1 for Unity 2020.x

    Since changes related to the CanvasRenderer being a required component was changes in recent Unity releases, make sure you are using the latest release of 2018.4 or 2019.4 or 2020.1 or 2020.2.
     
    IgorAherne and mcroswell like this.
  3. mcroswell

    mcroswell

    Joined:
    Jan 6, 2010
    Posts:
    79
    That helped me. I was about to give up.

    Still, it's too bad you can't have meta information with each release of Unity that suggests what package versions to use.

    Regardless, thanks for the post!