I have Camera that are in other additive scenes, is it possible to make to choose a custom blend? Like forcing it to "Cut" ?
Yes. In the CinemachineBrain, you can define an array of custom blends. This is an asset which exists independently of the scene. The From and To camera identifiers are name-based, so if there is a camera with the same name as in the custom blend definition, it will be found and the custom blend will be used
Thanks @Gregoryl Another question on the same topic, how priorities are handled in the custom blends? does the list is executed in order and stop as soon as it find a match? or all the "Any camera" are weaker than the rest? Also, is it possible to avoid to have the camera that "vibrate" when it's transitioning between two blend (it does that in some rare case)
Yes, the "Any Camera" is weaker. For the vibrating, you have to solve that on a case-by-case basis. Normally, it happens when the camera is closely tracking something that is not moving smoothly. It's a question of tracking down the source of the jerky movement.
It's vibrating for the combat camera when it's not locking a enemy. It's using a target group, i've managed to smooth-it up a bit by having entering and exiting enemies with a "Weight" that is fading in/out. like that it jump less but it's still not as smooth as what I used to have. there is also something that I've notice when doing a camera cut, it's cutting and then looking to the target. It the following video, you can see how far we got with cinemachine, it's blending with at least 10 cameras (There is the debug view in the top left corner)
Wow you game looks amazing. Yes, there are some unwanted strange / lumpy camera blends going on. It would be great to see a capture of the gameplay like this but with the Cinemachine debug turned on so we can see the camera switching. @sebsmax Your game looks fantastic and is an incredible use-case for Cinemachine. We will make sure you get it working exactly right. Yes, there's a giit repository, I'll get that to you in a PM
I actually found out the issue with the lumpy, instead of switching between cameras with a setActive, I do that: Code (CSharp): cameraExploration.Priority = (cameraMode == CameraModes.Exploration)?10:5; cameraCombat.Priority = (cameraMode == CameraModes.Combat) ? 10 : 5; cameraCombatLock.Priority = (cameraMode == CameraModes.CombatLock) ? 10 : 5; and I continuously update the positions of all Free camera. Now I'm trying to put back screen vibrations, but as much as I can dig into the code... I only find one part where the frequency is set, I wanted to do an "On/Off" on each camera with the frequency Code (CSharp): CinemachineBasicMultiChannelPerlin.cs float time = mNoiseTime * deltaTime * m_FrequencyGain;
@sebsmax You can play with CinemachineBasicMultiChannelPerlin.m_AmplitudeGain. Setting that to 0 is the same as turning it off. You can animate a pulse on it.
CinemachineVirtualCamera vcam; vcam.GetCinamchineComponent<CinemachineBasicMultiChannelPerlin>().m_AmplitudeGain = bla;
Cool I would never have guessed that! Code (CSharp): public CinemachineFreeLook[] CMGameplayCameras; [...] foreach (CinemachineFreeLook cmFreeLook in CMGameplayCameras) { for (int i = 0; i < 3; i++) { cmFreeLook.GetRig(i).GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>().m_AmplitudeGain = shakeIntensity * multiplier; } }
The effect of your sample video about cinemachine is shocking, I am learning to use cinemachine,and I don't know how to achieve the effect in your video. Can you tell me how the virtual camera in the video is placed, and when do you want to switch the camera? Looking forward for your reply, thank you!