Hello Guest

Author Topic: How can I get the normals for a tk2dTextMesh?  (Read 4381 times)

OnlineCop

  • Newbie
  • *
  • Posts: 11
    • View Profile
How can I get the normals for a tk2dTextMesh?
« on: March 16, 2013, 02:05:43 am »
I am applying some Megafier filters to my GameObjects so I can do funky effects, like stretching, wrapping, etc.

If I attach a Megafier onto a tk2dTextMesh in Unity while the app is NOT running, I can see the text bending around as expected in the Inspector. I get errors when I run the app with a Megafier attached, however, as it is trying to use the material's normals, which the TextMesh does not generate.

tk2dSprites, of course, have normals, so those are not adversely affected.

Have you used Megafiers? If so, do you know if a work-around so I can get its visual effects to apply to this text?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can I get the normals for a tk2dTextMesh?
« Reply #1 on: March 16, 2013, 05:55:58 pm »
In tk2dTextMesh, find the line which says RecalculateBounds();
and add one more line after that:
mesh.RecalculateNormals();

That should do it.