Page 1 of 2

CinemachinePriority sequence command issue

Posted: Thu Jul 22, 2021 12:25 pm
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.

Re: CinemachinePriority sequence command issue

Posted: Thu Jul 22, 2021 1:00 pm
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?

Re: CinemachinePriority sequence command issue

Posted: Thu Jul 22, 2021 3:30 pm
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?

Re: CinemachinePriority sequence command issue

Posted: Thu Jul 22, 2021 4:12 pm
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".

Re: CinemachinePriority sequence command issue

Posted: Thu Jul 22, 2021 5:16 pm
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.

Re: CinemachinePriority sequence command issue

Posted: Fri Jul 23, 2021 12:13 am
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?

Re: CinemachinePriority sequence command issue

Posted: Fri Jul 23, 2021 8:33 am
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.

Re: CinemachinePriority sequence command issue

Posted: Fri Jul 23, 2021 12:06 pm
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.

Re: CinemachinePriority sequence command issue

Posted: Fri Jul 23, 2021 12:56 pm
by Tony Li
Checking now. I'll post back here soon.

Re: CinemachinePriority sequence command issue

Posted: Fri Jul 23, 2021 1:16 pm
by Tony Li
(Still checking. I had posted a question, but now I'm able to reproduce the issue.)