Hi,
You'll want to use CinemachinePriority() without CinemachineTarget().
When you bump up the priority of a virtual camera (vcam), Cinemachine will smoothly move from its previous position (that is, the target of the previous highest-priority vcam) to the target of the new highest-priority vcam.
On the other hand, if you change a vcam's target using CinemachineTarget(), Cinemachine doesn't have two vcams to transition between, so it jumps to the new target.
Try this: Configure a virtual camera (vcam) to follow a specific character. For example, say the character GameObject is named "Ann". Create a vcam named "Ann vcam" that follows Ann.
Then use only CinemachinePriority() to raise the priority of that vcam. Example:
Code: Select all
CinemachinePriority(Ann vcam); {{default}}
The {{default}} makes the sequence also include the Dialogue Manager's Default Sequence, if you need that. If this sequence is the Default Sequence, or if you don't want to play the Default Sequence, omit {{default}}.
You can make this more general by relying on the built-in variable "Conversant", which is the name of the conversation conversant. Example:
Code: Select all
CinemachinePriority([var=Conversant] vcam); {{default}}
When you're talking with Ann, the value of "Conversant" will be "Ann". So "[var=Conversant] vcam" will evaluate to "Ann vcam".
Remember to set the priority back down when you no longer want to follow Ann.
Also, if you want to follow the NPC at the beginning of the conversation and stop following at the end, there's a simpler way. Add a Cinemachine Priority On Dialogue Event component to the NPC. Set Trigger to OnConversation, and assign the vcam.