Hi, I’ve got a worldspace text (without canvas), and a script that manipulates vertex transformations of the text.
When the text is unparented, something is triggering an automatic update of the TMP, causing character verticies to reset their position to default state.
This is unfortunate, because my own scripts do not modify the text each frame.
This causes a loss of the text effect.
How to handle it correctly?
I’ve tried restoring positions after unparenting, but it seems like too early, and TMP haven’t rebuilt yet.
As you have discovered there are certain events like changing properties of the text object or the size of the text container (RectTransform) or changing parenting, etc. that will trigger a rebuild of the text object.
To handle these case where you would need to re-modify the text geometry, you can subscribe to the
ON_TEXT_CHANGED event.
You can see an example of this use case in the Animating Vertex Attribute example which uses the VertexJitter.cs script and this event.
P.S. Right now, this event is fired after the geometry has been uploaded to the mesh. As per user suggestion, I am planning on adding a Callback something like “OnPreRenderText” that will be called before the geometry is uploaded to the mesh to provide for an opportunity to modify it. This will be more efficient 
1 Like
An old thread, same issue but now with execution of systems (Entities / Hybrid based).
Systems that write back results of mesh change run earlier than ON_TEXT_CHANGED events comes.
Basically what happens is:
0. Unparenting logic happens → queues up rebuilding
- WriteBackSystem (PresentationSystemGroup) – writes mesh data.
… Post LateUpdate
- ON_TEXT_CHANGED – invalidates previous mesh data due to rebuilding
As a result, frame is skipped, and its visible.
Any chance this rebuild logic gets moved somewhere where system order can be adjusted?
So that systems running in PresentationSystemGroup / LateUpdate could write results only once.
Edit: Hacked around it and run same logic from system twice on callback.
It is costly operation though. There should be no reason to do it twice if actual text do not change.
Managed to create a PostLateUpdateGroup and put custom logic there.
This removes the need of callback completely, as data is read & written after actual text has been updated.
See here how to add it: https://forum.unity.com/threads/postlateupdategroup-custom-playerloop-point-group.1454236/#post-9113044
Different question is load balancing, as jobs has to be scheduled and completed almost at the same time. But, its not a problem right now, so I’ll leave it be.