Hi,
about 50% of the time when I reload my scene by simply doing ```
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
[Exception] NullReferenceException: Object reference not set to an instance of an object
TextMeshProUGUI.UpdateSDFScale() Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMPro_UGUI_Private.cs:4264
Please test with the latest release which is 2.1.0-preview.4 for Unity 2019.x.
If the issue persists, it is likely HDRP and timing related. The easiest way for me to take a look at that would be for you to submit a bug report with the included project which would allow me to easily reproduce the behavior to figure out what is going on.
So I updated TMP package to 2.1.0-preview.4 for Unity 2019.x and when I intereact with UI objects while playing the game after a bit, I will get this error spammed when I move my mouse and I canât interact with the game at all. Iâm reverting to the latest non-preview version for now since this is worse than the previous error I was getting (which happens sometimes but regularly).
MissingReferenceException: The object of type 'CanvasRenderer' 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.UI.GraphicRaycaster.Raycast (UnityEngine.Canvas canvas, UnityEngine.Camera eventCamera, UnityEngine.Vector2 pointerPosition, System.Collections.Generic.IList`1[T] foundGraphics, System.Collections.Generic.List`1[T] results) (at /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/GraphicRaycaster.cs:321)
UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1[T] resultAppendList) (at /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/GraphicRaycaster.cs:225)
UnityEngine.EventSystems.EventSystem.RaycastAll (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1[T] raycastResults) (at /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:255)
UnityEngine.EventSystems.PointerInputModule.GetMousePointerEventData (System.Int32 id) (at /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/PointerInputModule.cs:277)
UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (System.Int32 id) (at /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:546)
UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () (at /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:532)
UnityEngine.EventSystems.StandaloneInputModule.Process () (at /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:289)
UnityEngine.EventSystems.EventSystem.Update () (at /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)
No the only thing I changed was updating the TMP package and reverting that change fixed the issue. When debugging, the faulty graphic (that is null and throwing the exception) is never from the same object but it is always a TMP mesh
I would like to take a look at the scene / figure out a way to reproduce this issue as everything in the above log references the ugui package / event system.
Can you submit a bug report with the included project and reproduction steps?
Weâre also having the ââCanvasRendererâ has been destroyedâ error since 2.1.0-preview.4.
I reported the bug with a minimal project as case 1225093.
While testing it I got it down to the following steps:
The text needs to be in a nested canvas (at least two)
The font has to have a fallback font and the text must make use of it.