How to play animations to spawned player when you use Corgi Engine?

Announcements, support questions, and discussion for the Dialogue System.
Ryoh
Posts: 9
Joined: Wed Jul 28, 2021 1:46 am

How to play animations to spawned player when you use Corgi Engine?

Post by Ryoh »

Hi, I have a question about how to play animations to player character.
I understand when you use Corgi Engine, use Conversation Zone, and tick Player is actor.
Then I have no idea how to play animations to spawned player character via conversation’s sequencer command.
Would you tell me how to do that?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Tony Li »

Hi,

When the player interacts with a Conversation Zone, the player GameObject will be the conversation's actor. In dialogue entry nodes where the player is the speaker (i.e., node's Actor dropdown is set to Player), you can use the special keyword 'speaker' in sequencer commands. If the player is the listener (i.e., Conversant dropdown is set to Player), use 'listener'.

Example:
  • Dialogue Text: "Hi! I'm the player!"
  • Sequence: AnimatorPlay(Wave, speaker); Delay({{end}})
Ryoh
Posts: 9
Joined: Wed Jul 28, 2021 1:46 am

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Ryoh »

Hi Tony, thank you for your quick reply.

I tried to do it, but it doesn’t work well.
Here is the setting.
When this is executed, console says Parameter “Talk1” does not exist,.
So something must be wrong, and I don’t know what that would be.

Without animating player character, I can not make cut scenes, so please help me.
Thanks.
Attachments
Here is the setting.
Here is the setting.
FB1E1BDF-494C-43BC-879D-CE762FF99586.png (89.05 KiB) Viewed 1008 times
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Tony Li »

Hi,

Make sure your NPC (actor named "Conversant" in your database) has an Animator with a trigger parameter named "Talk1".

Also make sure this GameObject is being used in the active conversation. To check this, temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. When a conversation starts, it will log a line similar to this:

Dialogue System: Starting conversation 'title' with actor=Player(Transform) and conversant=Conversant(Transform)

Make sure that:
  • The conversant is the correct GameObject,
  • It is assigned to the conversation properties' Conversant dropdown
  • It has the Animator component with the "Talk1" trigger parameter
When the conversation gets to your AnimatorTrigger() sequencer command, it will log two lines. The first will look like this:

Dialogue System: Sequencer.Play( AnimatorTrigger(Talk1, speaker)@0 )

The second line is the important one to examine. It will look like this:

Dialogue System: Sequencer: AnimatorTrigger(Talk1, Conversant(Transform))

Make sure the second part -- Conversant(Transform) -- is the GameObject with the Animator component.
Ryoh
Posts: 9
Joined: Wed Jul 28, 2021 1:46 am

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Ryoh »

Thank you for your replay Tony.

I checked what game object was Conversation actor.
Then I found out that a game object named Character01_Mouth_Event was assigned when the conversation started.
Before the conversation starts, it's empty.
I want it to be Player.
I thought if I ticked Player is actor in Conversation Zone, The Player is assigned as Conversation actor.
Am I right? or did I do something wrong?
Attachments
a.png
a.png (161.56 KiB) Viewed 978 times
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Tony Li »

Hi,

You can assign the NPC to the Dialogue System Trigger's Conversation Conversant field.

Is your player prefab tagged 'Player'? Are no other GameObject tagged 'Player'?

If you temporarily set the Dialogue Manager's Other Settings > Debug Level to Info, then when the conversation starts the Console will log a line like this:

Dialogue System: Starting conversation 'title' with actor=XXX and conversant=YYY

Make sure XXX is the player.
Ryoh
Posts: 9
Joined: Wed Jul 28, 2021 1:46 am

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Ryoh »

Hi Tony,
The problem has been partially solved! Thank you!
There was an other game object which tag was player, so Dialogue Trigger Event set the game object as Conversation actor.

It seems if I tick Can Move While Talking, the correct animation is played, but if I untick the option, the animation is not played.
The option affects the animation?
And if I untick the option, the player stops in the middle of air, when the player collide the event trigger.
Is there any way to make the player falls on the ground and can not be controlled by player?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Tony Li »

Hi,

If you tick Can Move While Talking, Corgi retains control of the player and its animations.

Later today, I'll post an updated Corgi Support package that adds an option to keep the player's physics simulation active. This will allow the player to land on the ground. However, if you player has a special landing animation, and if Can Move While Talking is true, it will not play this animation since that means Corgi would be controlling the animation and wouldn't allow you to control the animation in cutscenes.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Tony Li »

Hi,

This updated package will make the player land on the ground:

DS_CorgiSupport_2021-11-22.unitypackage

This new feature is turned on by default. If you ever want to turn it off, UNtick the Conversation Zone's 'Land On Ground While Talking'.
Ryoh
Posts: 9
Joined: Wed Jul 28, 2021 1:46 am

Re: How to play animations to spawned player when you use Corgi Engine?

Post by Ryoh »

Hi Tony,
The problem has been solved, thank you!
Post Reply