Trigger animations?

Announcements, support questions, and discussion for the Dialogue System.
User avatar
kyuubi
Posts: 52
Joined: Fri May 27, 2016 11:30 pm

Re: Trigger animations?

Post by kyuubi »

Hi everyone,

I am trying to achieve this but for some reason not being able to make this work.

I basically want to play the talking animation while the speaker is talking.

When I use AnimatorBool() or Play or PlayWait it plays the talk for like a split second and then goes back to idle. I am clearly doing something wrong, can you guys help me out!

Also, I'm using this integrated with Adventure Creator, not sure it matters.

Cheers,
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger animations?

Post by Tony Li »

Hi,

If you're using AC, you have a lot of options. If you've set up your characters with any of AC's lipsync configurations, you can use the ACSpeech() sequencer command described in the AC section of the Dialogue System documentation.

Otherwise, let's say you have two animation states, "Idle" and "Talk", where Talk moves the character's mouth up and down, with no transition arrow from Talk to Idle. Try this Sequence:

Code: Select all

AnimatorPlay(Talk); required AnimatorPlay(Idle)@{{end}}
This plays the Talk state right away. After a duration based on the text length, it plays the Idle state. The required keyword guarantees that it plays the Idle at the end even if the player skips ahead.

Since there's no transition arrow from Talk to Idle, it won't automatically switch back to Idle before you explicitly tell it to.
User avatar
kyuubi
Posts: 52
Joined: Fri May 27, 2016 11:30 pm

Re: Trigger animations?

Post by kyuubi »

Hi Tony,

Thanks for the quick feedback as usual.

I have create a duplicate talking state (as I need one for arrows) with no connections and it works, however it transitions very abruptly to the idle state now as it's not using the mecanim config with transition.

I looked into the docs and it seems this play function takes a crossfade argument but it's not working for me.

Any idea what it might be?

Thanks!
User avatar
kyuubi
Posts: 52
Joined: Fri May 27, 2016 11:30 pm

Re: Trigger animations?

Post by kyuubi »

Okay so it seems that what's happening is that both talking and idle are running at the same time.

Doesn't AnimatorPlay stop the other state after the call?
User avatar
kyuubi
Posts: 52
Joined: Fri May 27, 2016 11:30 pm

Re: Trigger animations?

Post by kyuubi »

More investigation.

It like there is some sort of caching going here. Before it wasn't working but now it's changing to idle. However once I update the crossfade time nothing happens.

It's as if the changes take a while to take effect. Am I doing something wrong probably?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger animations?

Post by Tony Li »

Hi,

Double check the syntax. The crossfade duration is the third parameter:

Code: Select all

AnimatorPlay(Talk, speaker, 0.5)
It may be useful to temporarily set the Dialogue Manager's Debug Level to Info. When it gets to the sequencer command, it will report what it's using as the value of each parameter.
User avatar
kyuubi
Posts: 52
Joined: Fri May 27, 2016 11:30 pm

Re: Trigger animations?

Post by kyuubi »

Hi Tony,

I managed to workaround this.

Basically for some reason, it seems that DS settings don't get saved sometimes, although I see them in the UI.

Say for example I change crossfade to 10 and I see no difference. I mess around trying to find out what's wrong and when I get to the inspector of that item (after a while) it still shows me the old config. I change it to 10 again and it now works. This has happened to me several times with DS on a number of occasions. The Editor shows me the change applied but it's actually not and only after a while will I see it's not applied in the editor.

That's why I thought it was cache initially. Any idea why this happens?

Cheers
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger animations?

Post by Tony Li »

Hi,

Please make sure you're using version 1.6.5+ of the Dialogue System. There was a bug in earlier versions that caused this issue in the Dialogue Editor window.
Post Reply