[HOWTO] How To: Loop Timeline Animation While Waiting For Continue

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 23278
Joined: Thu Jul 18, 2013 1:27 pm

[HOWTO] How To: Loop Timeline Animation While Waiting For Continue

Post by Tony Li »

If you use Timeline with conversations, you may want pause the timeline to wait for the player to click a continue button after each dialogue entry. (See How To: Pause Timeline While Waiting For Continue Button.)

However, Timeline presents a challenge. If you use Timeline to control a character's Animator, then when you pause the timeline it will freeze the Animator. So if you play a timeline during a conversation and pause it to wait for the "Continue" button, the character will stop animating.

Here are two ways to handle this:

1. Make short, individual timelines for each dialogue entry. Use the Timeline() sequencer command to play them. When the timeline is done, use another command such as AnimatorPlay() to play a looping animation. Example:

Code: Select all

Timeline(play, entrytag)->Message(Waiting);
AnimatorPlay(Idle)@Message(Waiting)
  • The first command will play the timeline on the GameObject named by the dialogue entry's entrytag. When the timeline is done, it will send the sequencer message "Waiting".
  • The second command will wait for the sequencer message "Waiting" and then play the animation state "Idle" on the speaker's Animator.
2. Or use a single timeline for the entire conversation, but don't use Animator tracks in Timeline. Instead, set each character's animator parameters manually. When you pause the timeline to wait for the continue button, the character's animation will continue to play because the timeline won't freeze its Animator.


Side note: If you're not using Timeline but you want to play a sequence while showing the player response menu, tick the dialogue entry's Add Response Menu Sequence checkbox. This will add a Response Menu Sequence field to the entry where you can specify sequencer commands to play while the response menu is waiting for the player to select a response button.
Post Reply