TextMeshPro NullReferenceException
Error message
NullReferenceException: Object reference not set to an instance of an object
TMPro.MaterialReference..ctor (...)What’s causing this
The HeroBridge Standalone example scene uses TextMeshPro for UI text. This error happens when TextMeshPro Essential Resources haven’t been imported into the project.
Without these resources, TextMeshPro can’t properly initialize its materials, which results in this NullReferenceException.
Fix: Import TextMeshPro Essential Resources
Open Unity’s top menu Window → TextMeshPro → Import TMP Essential Resources
Let Unity finish importing the files.
Close the affected scene.
Reopen the scene.
In most cases, this resolves the error immediately.
Don’t want to use TextMeshPro?
If you prefer not to use TextMeshPro at all, you can replace the TextMeshPro components in the example scenes with Legacy Text UI instead.
This avoids the dependency entirely.
Last updated