CinemachinePriority sequence command issue

Announcements, support questions, and discussion for the Dialogue System.
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

CinemachinePriority sequence command issue

Post by SealDev »

Sometimes when I play, the transitions stop working, and instead all nodes "cut" to the next camera, even all the ones which are not meant to cut.

I have not been able to identify what causes the issue. Once it breaks, it stops working for all dialogues (during that play session)

Other times when I play, all transitions play correctly.
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: CinemachinePriority sequence command issue

Post by Tony Li »

Hi,

Cinemachine has various blend settings. Is it possible that something (external to the CinemachinePriority sequencer command) is causing Cinemachine to change its blend settings to always cut?
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: CinemachinePriority sequence command issue

Post by SealDev »

Nope. No external change. Tested a lot and can't find the cause.

I have 2 characters called "Guard" and "Spotty". When I go through the conversation of the guard first, it would break Spotty afterward. Below are the entries i used for Guard that broke transitions multiple times for Spotty.

Entry1:
CinemachinePriority(Cam9, 2, cut);

Entry2:
CinemachinePriority(Cam9, 0, cut);
CinemachinePriority(Cam9b, 3, cut);

Entry3:
required CinemachinePriority(Cam9b, 0, cut)@6;


Strangely after making the modifications below it fixed it, but I do not understand the logic of why it works now.

Entry1:
CinemachinePriority(Cam9, 2, cut);

Entry2:
CinemachinePriority(Cam9b, 3, cut);

Entry3:
required CinemachinePriority(Cam9b, 0, cut)@6;

Entry4:
CinemachinePriority(Cam9, 0, cut);

Upon testing, it seems that Entry2 breaks spotty's dialogue transitions, despite the fact it uses a different camera "Cam11".
I still don't understand though why Entry2 makes all transitions "cut". Could it be that writing multiple CinemachinePriority commands in the same line creates a conflict?
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: CinemachinePriority sequence command issue

Post by SealDev »

Ok. Interesting findings:
Entry2:
CinemachinePriority(Cam9, 0, cut);
CinemachinePriority(Cam9b, 3, cut);

Is the exclusive cause that breaks it. It seems that removing cut from either one of the 2 lines above fixes the issue.
I don't understand why?

Also interesting fact: if any 1 line has cut will result in a cut transition even if other line has no cut.
Only if both lines have NO cut it transitions normally.

For some reason all dialogues after Entry2 will have a "cut" transition if both lines in entry 2 have "cut".
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: CinemachinePriority sequence command issue

Post by Tony Li »

Hi,

That's a bug. Please try this patch:

(see below)

When using 'cut', CinemachinePriority() records the current blend mode, then sets it to cut. When the command is done, it sets it back to the recorded mode.

When two CinemachinePriority() commands ran at the same time, one would record that the current blend mode was normal blend. Then it would set it to cut. Then the second command would record that the current blend mode was cut. So when the second command finished, it would leave the blend mode set to cut. This patch should address that.
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: CinemachinePriority sequence command issue

Post by SealDev »

Thank you :)

I assume the new fix does something like only record the default blend once at the start of the game instead of recording the state each time you run CinemachinePriority, right?
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: CinemachinePriority sequence command issue

Post by Tony Li »

Hi,

When a CinemachinePriority() command runs, it checks if no other active CinemachinePriority() commands have recorded the blend mode. If none have, it records the blend mode. When it's done, it restores the recorded blend mode.

However, if another active CinemachinePriority() command has recorded the blend mode, it doesn't restore the blend mode.

This allows you to change the blend mode during the game, and the CinemachinePriority() commands will continue to work with them properly.
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: CinemachinePriority sequence command issue

Post by SealDev »

I take it back!

Please do not commit this patch to all users! This new updated script is actually broken. Now all i have to do is use "cut" just once and it forever cuts all future dialogue.

I went back to previous script version with github, so for now I fixed it and just have to avoid using CinemachinePriority on 1 node, but I'm worried about future projects when i import this asset again.
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: CinemachinePriority sequence command issue

Post by Tony Li »

Checking now. I'll post back here soon.
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: CinemachinePriority sequence command issue

Post by Tony Li »

(Still checking. I had posted a question, but now I'm able to reproduce the issue.)
Post Reply