I'm working with the latest version of STM, and it seems that the On Complete Event is firing before text is finished writing out.
In my scene, I have an object that I would like to set as active after the text has finished writing out. However, the button is set as active as soon as the text starts writing out.
Here's the STM script settings:
Here's a shot from in game. Notice that the button has appeared before the text is finished:
I've already isolated this to the STM script by disabling the STM element, and noting that the button does not appear.
Any help is appreciated!
Edit:
This is for a jam project, so time is constrained. With that in mind, I decided to just drop into the STM script. What I found was that in
OnEnable()
, textMesh
is set to null before Rebuild()
is called.
In
Rebuild()
, Read()
is called on line 917. Read()
starts the ReadOutText
coroutine, but because textMesh
is still null, the while loop does not run, and the coroutine calls ShowAllText()
(which fires the on finished reading event) then exits.
As a quick fix, I just added textMesh != null
as a condition to the if statement on 916, and everything seems to work.