- Home /
Question by
digismonkeyking · Sep 01, 2021 at 09:45 PM ·
bugerror message
how do i fix this error? (textmeshpro version 2.1.6)
I have a panel set as a child to a canvas and to this panel I added a text-textmeshpro text box as a child of the panel. As is, if i go into play mode and then exit play mode it works as expected but if I take a custom font created using TMP's font asset creator and use it as the font for the text box, then when I enter play mode then exit play mode I get the error below.
MissingReferenceException: The object of type 'Material' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. UnityEngine.Object.get_name () (at :0) TMPro.TMP_SubMeshUI.AddSubTextObject (TMPro.TextMeshProUGUI textComponent, TMPro.MaterialReference materialReference) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_SubMeshUI.cs:214) TMPro.TextMeshProUGUI.SetArraySizes (TMPro.TMP_Text+UnicodeChar[] unicodeChars) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMPro_UGUI_Private.cs:1403) TMPro.TMP_Text.ParseInputText () (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_Text.cs:1902) TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMPro_UGUI_Private.cs:1644) TMPro.TextMeshProUGUI.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TextMeshProUGUI.cs:216) UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/CanvasUpdateRegistry.cs:210) UnityEngine.Canvas:SendWillRenderCanvases()Blockquote
Comment
it's like the error says, you are trying to access something that has been destroyed. You should post the relevant code.
Your answer
Follow this Question
Related Questions
!GetIsActive() 0 Answers
Unity giving already fixed error? 0 Answers
,why cant i build my project 0 Answers
Unity3D 4.2.0 Crasing ... 0 Answers