Page 1 of 1
Triggering animations with conversations
Posted: Sat Sep 16, 2017 7:52 pm
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?
Re: Triggering animations with conversations
Posted: Sat Sep 16, 2017 8:21 pm
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.
Re: Triggering animations with conversations
Posted: Sat Sep 16, 2017 10:32 pm
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).
Re: Triggering animations with conversations
Posted: Sat Sep 16, 2017 10:35 pm
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.
Re: Triggering animations with conversations
Posted: Sat Sep 16, 2017 10:41 pm
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?
Re: Triggering animations with conversations
Posted: Sun Sep 17, 2017 9:19 am
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.