Add a delay to a leaf within a parallel


#1

In testing today I realized that I was introducing huge lag in my sequences due to the fact that Jibo could not give his verbal response until after my animation completed. The logical solution was to put the speech and animation within a parallel.

This removed all of the lag. But now I have the problem that the verbal response is happening just a second or two too soon. So applying the little knowledge I’ve picked up so far, I added a TimeoutSucceed decorator to the text2speach leaf. But since the T2S leaf will always succeed, my decorator is ignored. So I will put this to the professionals. Any assistance in this would be greatly appreciated. Hopefully I am explaining this correctly.

Here is a map of the sequence for visual aid:

Thanks,
Tony


#2

It sounds like, in your current setup, you are looking to make sure that the TextToSpeech behavior doesn’t execute before the beginning of the animation and, currently, it is starting a moment too soon.

One of the best methods to sync up the beginning or part of a PlayAnimation behavior with a separate behavior like TextToSpeech is to use the event layer in the animation tool (described here ) in conjunction with the StartOnAnimEvent decorator in the behavior tree.

In the behavior tree that would look like this:

That tells the TextToSpeech to wait until it gets an event from the animation before it executes. To make that work you will also need to add an event layer to your animation, key the frame that you want the TextToSpeech to wait for, and give the event the same Name property as you enter in the eventName argument for the StartOnAnimEvent decorator in the behavior tree. You’ll see in the above screen that I set the eventName to “eventhappen”.

In my skill, I wanted the TextToSpeech to wait until the 150th frame of my animation. So, I added an event layer to my animation, keyed the 150th frame, and placed "eventhappen"in the Name field as seen here:

For your purpose you might want to key the first frame of your animation with the event layer if your primary goal is to make sure that the TextToSpeech behavior starts at the same time as your animation.


#3

That’s EXACTLY what I was looking for!!!

Thank you!!!

Tony