Page 1 of 1

[Solved] CinemachinePriority except

Posted: Sun Oct 24, 2021 7:28 pm
by Deses
Hi!

I have a problem trying to understand how to use the "except:GameObject" vcam parameter.
CinemachinePriority()
Syntax: CinemachinePriority(vcam, [priority], [cut])

Parameters:

vcam: The name of a GameObject containing a CinemachineVirtualCamera. Alternatives for this parameter:
all: Set the priority of all vcams.
except:GameObject: Set the priority of all vcams except the one named GameObject.
priority: (Optional) New priority level. Default: 999.
cut: (Optional) Cuts immediately to the new vcam instead of easing to it.
According to the docs, if I use "except:vcamName" as the first parameter, it should set the priority for all other cameras other than vcamName.

I'm using it as shown:

Code: Select all

CinemachinePriority(except:vcamName, 0);
And I'm getting this error:

Code: Select all

Dialogue System: Sequencer: CinemachinePriority(except:vcamName,0): Can't find virtual camera 'except:vcamName.
UnityEngine.Debug:LogWarning (object)
Debugging the class "CinemachineVirtualCamera" I see at line 24 that

Code: Select all

var vcam = (subject != null) ? subject.GetComponent<CinemachineVirtualCamera>() : null;
subject is null.

Removing "except:" changes the priority for the specified camera.

Re: [Solved] CinemachinePriority except

Posted: Sun Oct 24, 2021 8:09 pm
by Deses
So, the issue was that the branch I'm in had an outdated of Dialogue System. :facepalm:

I'm going to blame our devops for not merging the updated DS into main yet. :D

Re: [Solved] CinemachinePriority except

Posted: Sun Oct 24, 2021 8:12 pm
by Tony Li
Ah, I was just about to suggest that. Glad you got it all sorted out.