I want to create a scenario when characters talk to each other but at some points they pause the conversation to play an animation. Let's say we have Bob and Marry and it goes like that:
- Code: Select all
Bob: Hi Marry!
Marry: Hi Bob!
//put some chit-chat between Bob and Marry
Marry: Do you have the chocolade?
if(Bob.HasChocolade)
{
Bob: Yes, I have.
Unity.CallEvent("Play Bob giving the chocolade");//<- here we wait for animation to end
Marry: Thanks you!
}
else
{
Bob: No, I don't.
Marry: Oh, it's a bummer.
}
Marry: Let's go back to school.
//The conversation still goes as the kids are walking down to the school
As far as I've found there is no dedicated Flow Fragment for doing such a thing. I could listen to a particular variable and ask story designers to put animation requests that way in Instruction Fragments. But it might be too much error-prone as we are going to implement also much more complicated branching and events. Is there a better way to do such a thing?