Search Unity

Cinemachine Multiple Point Of Interest cameras

Discussion in 'Cinemachine' started by IvayloDev, Jul 24, 2020.

  1. IvayloDev

    IvayloDev

    Joined:
    Apr 20, 2015
    Posts:
    23
    Hello, I am implementing point of interest cameras in my game where I want when I activate an event object to spawn a camera in the cinemachine mixing component and lerp the weight of that camera.

    The problem is that if I have already a POI camera and both the main camera and POI camera have equal weight amounts (0.5 on both of them) , when I add a third camera the weight of them is shifted and I cannot easily control the new weight amount. My question is: is there some formula that I can use to make it work or if there is an alternative way to deal with this problem. I want to set the camera weight for example from 0(no focus) and 1(camera is focusing the target) and the camera mixer component to handle the weights
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    The mixing camera algorithm for the effective weight of a camera is (camera weight) / (sum of all camera weights). If you want to blend your incoming camera from 0 effect to full effect, start its weight at 0 and lerp to 1, while at the same time lerping all the other camera weights to 0.