Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Choppy camera transition when using cylindrical position blend hint

Discussion in 'Cinemachine' started by markskelton, Nov 18, 2019.

  1. markskelton

    markskelton

    Joined:
    Dec 29, 2015
    Posts:
    3
    I have two cameras in my scene, both of which are using orbital transposers. They both follow and look at the same target. The target that they follow is the player. When the A button is pressed, I disable one of the cameras so that the other camera will then be used, which is following directly behind the player. I am using a cylindrical position blend hint on each camera. Everything works fine when the transition occurs while the player is not moving. Although when the player is moving towards the camera and the transition occurs, the transition becomes very choppy. It looks as if the camera can't decide which direction to rotate in and jumps to opposite sides of the orbit while transitioning.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Can you make a small demo project that shows this and DM it to me?
     
    markskelton likes this.
  3. starvae_netease

    starvae_netease

    Joined:
    Jul 11, 2019
    Posts:
    2
    I also encountered this problem
     
  4. starvae_netease

    starvae_netease

    Joined:
    Jul 11, 2019
    Posts:
    2
    local a = Vector3(-2.385925, 0, 5.675659)
    local b = Vector3(3.578064, 0, -8.373657)
    local t = 0.4702685
    local c = Vector3.Slerp(a,b,t)

    local a = Vector3(-2.385864, 0, 5.675476)
    local b = Vector3(3.49762, 0, -8.376831)
    local t = 0.4976589
    local c = Vector3.Slerp(a,b,t)

    For example, the c calculated from these two sets of data is very different, resulting in a large difference in the results
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Yes, the blend will find the shortest spherical path between the 2 camera positions, based where they are at the current frame. No state is saved. So, if the cameras are moving and the shortest path changes, there will be a pop.