Page 1 of 1

problems of using dialogue system with timeline and cinemachine

Posted: Thu May 14, 2020 9:50 pm
by Krystal
Hi, i am new to dialogue system and i really love it.
But i have some problems when using dialogue system with timeline and cinemachine.

1、Timeline
In the manual,i noticed that there is a "#:binding" parameter in Timeline(). I have a dialogue which is controlled by timeline and I want to bind a npc (the conversant in the dialogue) to the first track of timeline to play animations but it doesn't work.
This is what i write in the sequence:

Code: Select all

Timeline(play,timelinecs,,nostop,0:Private Hart);
{{default}}
I also tried to add the Timeline Trigger component to the npc and assigned the npc to “Bindings”. But it doesn't work either.
How should i do it?

2、Cinemachine
I am trying to use cinemachine cameras in the dialogue.
When dialogue happens the player’s camera should be cut to CameraNpc(a camera that looks at npc) and when player speaks the camera should be cut to CameraPlayer(a camera that looks at player which is different from the camera when you control the player).
I followed this post http://pixelcrushers.com/phpbb/viewtopi ... hine#p7549 and set my conversation's 
Default Sequence to

Code: Select all

CinemachinePriority(CameraNpc,99,cut);
CinemachinePriority(CameraPlayer,0,cut); 
CinemachineTarget(CameraNpc)
 Default Player Sequence to:

Code: Select all

CinemachinePriority(CameraNpc,0,cut);
CinemachinePriority(CameraPlayer,99,cut); 
CinemachineTarget(CameraPlayer)
I also added the Cinemachine Camera Priority On Dialogue Event component to my player to set the player control camera’s priority to 0 during the conversation.
My problem is when the first time my cameras change between each other there is still a blend.The cameras still move to each other instead of cut.(for example, the first time CameraNpc change to CameraPlayer there is a blend but since the second time the ”cut” works fine)

I am not sure if i am doing it right.Could you please give me some help?
I am using unity Unity 2019.1.14f1 (64-bit),Dialogue System 2.2.6

Thanks so much!

Re: problems of using dialogue system with timeline and cinemachine

Posted: Thu May 14, 2020 11:37 pm
by Tony Li
Hi,

Thanks for using the Dialogue System!
Krystal wrote: Thu May 14, 2020 9:50 pmIn the manual,i noticed that there is a "#:binding" parameter in Timeline(). I have a dialogue which is controlled by timeline and I want to bind a npc (the conversant in the dialogue) to the first track of timeline to play animations but it doesn't work.
This is what i write in the sequence:

Code: Select all

Timeline(play,timelinecs,,nostop,0:Private Hart);
{{default}}
That should work. The binding parameters can be anywhere after the mode and Timeline name, such as:

Code: Select all

Timeline(play,timelinecs,nostop,0:Private Hart)
(In other words, you can get rid of the extra comma in this case. Most sequencer commands have specific parameter positions that are more strict.)

Are you sure the NPC exists in the scene with the exact name you're specifying, including capitalization and spaces?

Are there any errors or warnings in the Console?
Krystal wrote: Thu May 14, 2020 9:50 pmI also tried to add the Timeline Trigger component to the npc and assigned the npc to “Bindings”. But it doesn't work either.
This way avoids issues with GameObject names. Are there any errors or warnings?
Krystal wrote: Thu May 14, 2020 9:50 pm2、Cinemachine
I am trying to use cinemachine cameras in the dialogue.
When dialogue happens the player’s camera should be cut to CameraNpc(a camera that looks at npc) and when player speaks the camera should be cut to CameraPlayer(a camera that looks at player which is different from the camera when you control the player).
I followed this post http://pixelcrushers.com/phpbb/viewtopi ... hine#p7549 and set my conversation's
Default Sequence to

Code: Select all

CinemachinePriority(CameraNpc,99,cut);
CinemachinePriority(CameraPlayer,0,cut); 
CinemachineTarget(CameraNpc)
Default Player Sequence to:

Code: Select all

CinemachinePriority(CameraNpc,0,cut);
CinemachinePriority(CameraPlayer,99,cut); 
CinemachineTarget(CameraPlayer)
Try changing the order:

Code: Select all

CinemachinePriority(CameraPlayer,0); 
CinemachineTarget(CameraNpc);
CinemachinePriority(CameraNpc,99,cut);
You only need the 'cut' once, on the camera that you're actually cutting to -- that is, the camera with the highest priority.

If that doesn't help, or if you're still seeing issues, please feel free to send a project to tony (at) pixelcrushers.com. I'll be happy to take a look.

Re: problems of using dialogue system with timeline and cinemachine

Posted: Fri May 15, 2020 11:41 am
by Tony Li
Thanks for sending a reproduction project. Recent versions of Cinemachine and Timeline had 2 changes that require updated sequencer commands. I sent you a patch in an email reply. It's also available on the Dialogue System Extras page.

Re: problems of using dialogue system with timeline and cinemachine

Posted: Sun May 17, 2020 9:59 pm
by Krystal
It's working! Thanks so much for your help!

Re: problems of using dialogue system with timeline and cinemachine

Posted: Mon May 18, 2020 8:55 am
by Tony Li
Happy to help!