Hello Guest

Author Topic: [SOLVED] committing text doesn't work  (Read 5574 times)

kiriri

  • Newbie
  • *
  • Posts: 4
    • View Profile
[SOLVED] committing text doesn't work
« on: November 22, 2012, 06:38:52 pm »
Hey, I've got a problem here.
I'm using playmaker but I checked all the scripts and don't see why this is happening:

I change the name of a text, based on the active language, right after the text is loaded with the scene. Then I change the language and call the text naming again. It changes the language (as seen in the inspector) and it even uses the real text if I calculate the bounding box, but even so it still renders the old text.
Do you know any reasons why this could be?

best,
kiriri
« Last Edit: November 24, 2012, 10:50:09 am by kiriri »

kiriri

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: committing text doesn't work
« Reply #1 on: November 22, 2012, 07:00:16 pm »
ok, I actually stumbled on the solution quite by accident. If I comment out the part which calculates the bounds and applies them to the collider every frame starting right after I call the text.commit , it works perfectly... must be unity messing with priorities here or something. Weird thing that it works the first time though.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: committing text doesn't work
« Reply #2 on: November 22, 2012, 08:51:33 pm »
Is this code in the playmaker tk2d interface?

kiriri

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: committing text doesn't work
« Reply #3 on: November 24, 2012, 09:53:33 am »
I don't understand what you mean by tk2d interface.
The excact line in my action that breaks the commit function is this :
Code: [Select]
Mesh meshy = go.GetComponent<MeshFilter>().mesh;If I comment this out, everything works great. But I need it to calculate the mesh.bound.size incase the text is rotated. Thank you for your quick response btw :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: committing text doesn't work
« Reply #4 on: November 24, 2012, 10:27:25 am »
You should never ever get .mesh. That will duplicate the mesh and wreak all sorts of havoc.
Use .sharedMesh instead and you'll find everything works a lot better.

kiriri

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: committing text doesn't work
« Reply #5 on: November 24, 2012, 10:49:45 am »
wow thanks, I used that for ,like, forever, now I get why I always run into these kinds of problems :D
It works flawlessly now, thank you sir :)