Forum rules - please read before posting.

Animating Speakers

Is there any way to trigger a certain player animation whenever a player is talking using the mechanin settings of the character to change a parameter? Or would I have to custom trigger that talking animation?

Comments

  • Could you elaborate with a practical example?  Change which parameter in what way?

    When used with a Mecanim character, the Character: Animate Action can be used to change a character's parameter values, but the Dialogue: Play speech Action can be used to play per-speech-line head and mouth animations by name.  Various lip syncing options are also available within the Speech Manager.
  • Right now, I animate my characters by changing a Bool parameter to trigger Mocap animations. Then I will turn that bool off when I'm done. I was wanting to do a trigger in order to have a mocap animation play from my third person animator. But I couldn't find a simple way to do this. I was just wondering if there were some automated way to get AD to do a trigger when I wanted a character to talk without having to manually input that every single time.
  • edited April 2018
    A different animation each time, or the same one for each speech line?

    If you provide a "Talk bool" parameter in your character's Inspector, it'll be set to True/False automatically when the character speaks.  If you don't want to rely on that, and use a Trigger parameter, then you can hook into the OnStartSpeech custom event.

    Custom events are a way of running custom code when AC performs common tasks - in the case of OnStartSpeech, when a character begins speaking.  A tutorial on using this event can be found here, and more details can be found in the "Custom events" chapter of the Manual.

    An example use of this event to trigger the speaking character's "myTriggerName" parameter:

    void GetSpeech (AC.Char speakingCharacter, string speechText, int lineID)
    {
        speakingCharacter.GetAnimator ().SetTrigger (myTriggerName);
    }

    Replace that with the GetSpeech method covered in the linked tutorial, change "myTriggerName" to the Trigger you want to invoke, and add it to your scene.
  • That first option is exactly what I need. Thanks so much!
  • Please see the Manual's "Character animation (Mecanim)" chapter for a full list of the parameters available to Mecanim-based characters.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.