Page 1 of 1
Best Way to Pause While Using Text Animator?
Posted: Thu Jul 06, 2023 6:56 am
by GeoffFree
I'm currently using Text Animator, which doesn't really work with Time.time = 0. I tried going into the Dialogue System Trigger script and adding content that would disable player movement using a bool automatically, but for reasons beyond my knowledge, I cannot access my own scripts. The alternative I have right now is manually adding an OnExecute that does a script which pauses the player, however, this means manually adding it for every NPC. Will I have to keep doing this, or is there a better way?
Re: Best Way to Pause While Using Text Animator?
Posted: Thu Jul 06, 2023 8:56 am
by Tony Li
Hi,
I strongly recommend against directly editing Dialogue System scripts. Instead, use event hooks or inheritance. For example, you can create a subclass of
DialogueSystemTrigger that overrides certain behavior. However, in this case it's not necessary. Add a
Dialogue System Events component to your player and configure its OnConversationStart() event to pause the player and OnConversationEnd to unpause. For details, see the
Interaction video tutorial.
(BTW, the reason why you can't access your own scripts inside Dialogue System scripts is because the Dialogue System is in the Plugins folder. Scripts in the Plugins folder are compiled first, without any visibility to scripts that are outside of Plugins.)
You may need to contact the Text Animator dev about pausing Text Animator. From a quick glance, it looks like if you set the Text Animator's animationLoop to AnimationLoop.Script, it will stop typing. Then you should be able to set it back to AnimationLoop.Update to resume typing.
Re: Best Way to Pause While Using Text Animator?
Posted: Thu Jul 06, 2023 9:45 pm
by GeoffFree
Oh, thanks. Somehow I completely missed OnConversationStart even though I had the OnConversationEnd set up properly. Thanks for reminding me otherwise I would have never realised to do that.
Re: Best Way to Pause While Using Text Animator?
Posted: Thu Jul 06, 2023 10:13 pm
by Tony Li
Glad to help!