Hello Guest

Author Topic: Keep getting null ref with text...  (Read 4731 times)

hippocoder

  • Guest
Keep getting null ref with text...
« on: February 13, 2014, 10:16:54 pm »
Quote
NullReferenceException: Object reference not set to an instance of an object
tk2dTextMesh.NumTotalCharacters () (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:462)
tk2dTextMeshEditor.OnInspectorGUI () (at Assets/TK2DROOT/tk2d/Editor/Fonts/tk2dTextMeshEditor.cs:330)
UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty)
UnityEditor.DockArea:OnGUI()

Floods whenever I select a textmesh. Any idea why?

hippocoder

  • Guest
Re: Keep getting null ref with text...
« Reply #1 on: February 13, 2014, 10:19:52 pm »
Selecting the font to another font then back again in textmesh fixes the spam.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Keep getting null ref with text...
« Reply #2 on: February 14, 2014, 09:46:58 am »
Does it just happen on the one text mesh, or all of them?
From that line it looks like you may have unicode chars in your font, and the dictionary is not initialised. Is the font from a sprite collection?

hippocoder

  • Guest
Re: Keep getting null ref with text...
« Reply #3 on: February 14, 2014, 04:29:49 pm »
The font is just a standalone retro font from 1001fonts.com converted to an atlas. I am using the string "hello world", and it's a random problem... comes and goes. Seems to affect prefabbed ones more than others and changing the atlas collection for the font (I don't mix fonts with sprite atlases) appears to clear it up for a while.

What can I provide to help track it down?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Keep getting null ref with text...
« Reply #4 on: February 14, 2014, 04:53:38 pm »
If you can create a really simple repro project, that would be perfect. Any way to repro would really really help track this down otherwise we're gonna waste loads of time with diagnostics & debug stuff.