Talking animation loop (Mecanim)
Talking animation loop (Mecanim)
How to match the loop of a talking animation to the size of the dialogue text?
Re: Talking animation loop (Mecanim)
Hi,
Is it just a mouth-open / mouth-close animation? If so, give the character an Animator with two states: one for the talking animation, and another for an idle animation. Let's say they're called "Talk" and "Idle". Then set the dialogue entry's Sequence to:
To avoid having to enter this for every dialogue entry, you can instead set the Dialogue Manager's Default Sequence.
Is it just a mouth-open / mouth-close animation? If so, give the character an Animator with two states: one for the talking animation, and another for an idle animation. Let's say they're called "Talk" and "Idle". Then set the dialogue entry's Sequence to:
Code: Select all
AnimatorPlay(Talk);
AnimatorPlay(Idle)@{{end}}
Re: Talking animation loop (Mecanim)
Thanks for the reply. Also, I have a continue button on the UI and i had it on always but, how do I give the next conversation node a delay? When I press continue I wanna give it a delay before proceeding to the next.
Re: Talking animation loop (Mecanim)
So I have it clear: When the player clicks the continue button, it should stop the talking animation, wait for a delay, and then continue to the next stage in the conversation?
If so, here's one way to do that:
1. Change the Sequence to:
2. On the continue button, remove the Unity UI Continue Button Fast Forward if it's there. Instead, add a script like this:
SpecialContinueButton.cs
If so, here's one way to do that:
1. Change the Sequence to:
Code: Select all
AnimatorPlay(Talk);
AnimatorPlay(Idle)@Message(StopTalking)
SpecialContinueButton.cs
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class SpecialContinueButton : UnityUITypewriterEffect {
public float delayBeforeContinue = 2;
public override void OnFastForward() {
if ((typewriterEffect != null) && typewriterEffect.IsPlaying) {
typewriterEffect.Stop();
} else {
Sequencer.Message("StopTalking");
Invoke("Continue", delayBeforeContinue);
}
}
public void Continue() {
if (dialogueUI != null) dialogueUI.OnContinue();
}
}
Re: Talking animation loop (Mecanim)
Thanks a bunch Tony How do I make Delay() to work? It's only working on conversations that doesn't have a continue button. Example of what I wanna do :
Anemone : We should go back home before the sun sets. (Player clicks continue) (fade out, wait 5 seconds before moving to the next conversation node then fade in.) How do I do it?
Anemone : We should go back home before the sun sets. (Player clicks continue) (fade out, wait 5 seconds before moving to the next conversation node then fade in.) How do I do it?
Re: Talking animation loop (Mecanim)
If you want to do this on every dialogue entry, use the SpecialContinueButton.cs script I provided above, but modify it to also fade out and in.
If you only want to do it on specific dialogue entries, here's an example of using an extra dialogue entry node:
FadeDelayExample_2017-03-04.unitypackage
It uses this Sequence:
The Sequence does this:
Time Action
0:00 Fade out
0:01 Show a black cover over the screen (I added "BlackOverlay" to the scene.)
0:06 Hide the black cover
0:06 Fade in
0:07 Continue without requiring the player to click the continue button
If you only want to do it on specific dialogue entries, here's an example of using an extra dialogue entry node:
FadeDelayExample_2017-03-04.unitypackage
It uses this Sequence:
The Sequence does this:
Time Action
0:00 Fade out
0:01 Show a black cover over the screen (I added "BlackOverlay" to the scene.)
0:06 Hide the black cover
0:06 Fade in
0:07 Continue without requiring the player to click the continue button
Re: Talking animation loop (Mecanim)
Thanks. Silly me. I should've consulted the documentation first before posting. Thanks Tony
Re: Talking animation loop (Mecanim)
No worries! If I can help any more with this, please let me know.
Re: Talking animation loop (Mecanim)
Is it wise to have all conversation entries in just one conversation in the database when making visual novels?
Re: Talking animation loop (Mecanim)
It's entirely up to you.harumin wrote:Is it wise to have all conversation entries in just one conversation in the database when making visual novels?
The advantage of one conversation is that everything is visible on the same canvas.
You can also use multiple conversations and link between conversations. To add a cross-conversation link, click on the source dialogue entry. From the "Link To:" dropdown, select "Another Conversation". The advantage of multiple conversations is that you can break up your content, which may make it easier for you to organize and navigate it.
In either case, it's usually easiest to have only one entrypoint in your gameplay -- that is, when starting a new game, always start the same conversation.