5

I can't find how to constantly dynamically blend between 3 cameras (I call them middle, upper & lower) based on the rate and height of the hero, constantly.

When following the hero, the middle vCam is the main/base one, I'd like to proportionally blend through upper and lower vCams based on the height of the hero.

The player/hero can move rapidly between heights, so the blend should be weighted with eases. Which is a natural part of Cinemachine blends. And works. But it's like a switch, to me, at my current understanding of Cinemachine blends, rather than a constant dynamic blending based on height.

Confused
  • 6,048
  • 6
  • 34
  • 75

2 Answers2

4

You may consider removing the upper and lower camera and do your own "Manual blending" with only the middle camera. Recently I've been using Cinemachine and I do something similar of what your desired result is.

Since I don't exactly know how do you want your camera to behave, I show you some of my manual blending I've done, explained:

//Camera Direction
//If I´m not in ground, and I've been on the air for a specific time
if (!onGround && timeSinceLastJump > cameraDelay)
{
   //Moves the offset of the camera down to the maximum allowed y offset (In your case it would be where the lower camera is)
    if (vcam.GetCinemachineComponent<CinemachineTransposer>().m_FollowOffset.y >= maxYOffset)
        vcam.GetCinemachineComponent<CinemachineTransposer>().m_FollowOffset.y -= offsetYSensivity;
    //It also zooms out up to a specified level
    if (vcam.m_Lens.OrthographicSize < maxFOV)
        vcam.m_Lens.OrthographicSize += camSensivity;
}
else
{
    //Same but upwards
    if (vcam.GetCinemachineComponent<CinemachineTransposer>().m_FollowOffset.y <= minYOffset)
        vcam.GetCinemachineComponent<CinemachineTransposer>().m_FollowOffset.y += offsetYSensivity;
    //Same but zooming in
    if (vcam.m_Lens.OrthographicSize > minFOV)
        vcam.m_Lens.OrthographicSize -= camSensivity;
}

This way you can use your player height in the conditions, at the cost of having to design well the camera logic.

Maybe this helps you in some way to do what you want.

janavarro
  • 869
  • 5
  • 24
  • 1
    Argh, Jose, I like the way you think. This is somewhat akin to my backup plan, if I can't find a way to dynamically blend between vCams. The only difference, I'm going to probably use an AnimationClip that's got an Upper, Lower and Middle positions, and gradients between them, and all the different settings for each of these positions, and then sample it based on the sorts of criteria you're suggesting. Thank you. It is a great relief to see that someone else has considered this kind of problem from this kind of perspective. THANK YOU! – Confused May 20 '19 at 16:10
  • 1
    Jose, good news! There is a "camera" specifically designed to do this, called a CinemachineMixingCamera. It should be called a CinemachineMixingBlender, but it does just what we're wanting, blends between multiple cameras based on a weighting value that's dynamically adjustable. Starts with 8 slots for 8 cams! – Confused Jun 19 '19 at 07:31
-2

From what I remember, you can define the blend style in the Cinemachine blend options. From the description, it seems that it is set to "Cut" when you probably want something similar to EaseIn/EaseOut. It even allows you to define your own custom blend between cameras if the default options do not work for you.

Take a look at the documentation for more details.

localhost
  • 169
  • 6
  • This, unfortunately, has almost nothing to do with the question. – Confused May 17 '19 at 18:35
  • The TYPE of blend is not what I'm concerned about. With the exception of cut type non-blends and blends of zero duration, the blend type is irrelevant. I'm looking to control the AMOUNT of blend activity undertaken based on other dynamic qualities, dynamically. – Confused May 17 '19 at 18:38
  • 1
    Ah, I misunderstood the main problem then. I have done custom camera blend based on specified external conditions (which can vary dynamically) for creating an editor tool but that doesn't involve CineMachince. Jose's solution above may be closer to what you need. – localhost May 20 '19 at 14:52