Triggering animations with conversations

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nRedux
Posts: 10
Joined: Sat Sep 16, 2017 6:25 am

Triggering animations with conversations

Post by nRedux »

I have yet to see how to trigger an animation on a game object when a conversation element is presented. I saw with portraits you can trigger them via a pic tag, but even that was hard to find general information on. How can I trigger animations?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Triggering animations with conversations

Post by Tony Li »

Hi,

Use the AnimatorPlayWait() sequencer command in the node's Sequence field. For example, say your NPC has an animator state named "dance":
  • Dialogue Text: "Watch me dance!"
  • Sequence: AnimatorPlayWait(dance)
You can read more about sequences here.
nRedux
Posts: 10
Joined: Sat Sep 16, 2017 6:25 am

Re: Triggering animations with conversations

Post by nRedux »

Thank you for the quick reply. The only way I've seen to associate a game object to a piece of dialog was with the ConversationTrigger component. What other methods are there? I'm sorry if I'm overlooking things, this is a somewhat expansive product (that's a good thing).
nRedux
Posts: 10
Joined: Sat Sep 16, 2017 6:25 am

Re: Triggering animations with conversations

Post by nRedux »

I believe I found more information about associating game objects with conversations in the docs, I'll add another reply if I'm still confused later.
nRedux
Posts: 10
Joined: Sat Sep 16, 2017 6:25 am

Re: Triggering animations with conversations

Post by nRedux »

I am doing something akin to a graphic novel. I have a character on screen who speaks to the player who has no model. What's the best way to start these sorts of conversations so the character who's speaking has their game object associated with the conversation?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Triggering animations with conversations

Post by Tony Li »

Can you create an empty GameObject for the model-less player? This way in the future you can add scripts to it in that can receive player-specific messages such as OnConversationStart for conversations that involve the player. Otherwise, you can just leave the Conversation Trigger's Actor field blank, and assign the NPC to the Conversant field.

If you want to set different default sequences for the NPC vs. the player, you can set the Dialogue Manager's Camera Settings > Default Sequence and Default Player Sequence fields. For example, the sequences below do a closeup of the NPC and wait for a time, but for the player it only waits (since the player doesn't have a model to do a closeup on):
  • Default Sequence: Camera(Closeup); Delay({{end}})
  • Default Player Sequence: Delay({{end}})
If the Default Player Sequence is blank, it will use the Default Sequence for the player.

If you haven't already read How GameObjects Are Associated With Conversations, you may find it handy.
Post Reply