Best Way to Pause While Using Text Animator?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
GeoffFree
Posts: 4
Joined: Thu Jul 06, 2023 6:24 am

Best Way to Pause While Using Text Animator?

Post 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?
User avatar
Tony Li
Posts: 22124
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best Way to Pause While Using Text Animator?

Post 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.
GeoffFree
Posts: 4
Joined: Thu Jul 06, 2023 6:24 am

Re: Best Way to Pause While Using Text Animator?

Post 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.
User avatar
Tony Li
Posts: 22124
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best Way to Pause While Using Text Animator?

Post by Tony Li »

Glad to help!
Post Reply