Search Unity

Question Flickering transition between vcam and freelook

Discussion in 'Cinemachine' started by jeromeisabelle, May 4, 2023.

  1. jeromeisabelle

    jeromeisabelle

    Joined:
    Aug 29, 2018
    Posts:
    21
    When transitioning from a basic virtual camera to a freelook camera following a player, the main camera rotation around the y axis if switching from negative to positive every frame, which causes a big flickering during the transition. Have you ever heard of this kind of behaviour? If so, what could be the cause of that?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Yeah, that's cropped up from time to time, there are a couple of workarounds. Can you show the settings and the relative positions of freeLooks and targets? It's going to be geometry-related. A pure top-view of the situation would be ideal.
     
  3. jeromeisabelle

    jeromeisabelle

    Joined:
    Aug 29, 2018
    Posts:
    21
    The cameras are fairly far apart so it's kinda hard to see, but in summary the vcam is behind the freelook and higher, and the freelook is behind the player and selected in this screenshot. Also, the problem is not consistent, sometimes it happens and sometimes it doesn't.

    upload_2023-5-4_19-59-37.png
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Thanks but I need to see more of the inspectors so that I can repro this and understand what's happening. Can you please show the full inspectors of both the freelook and the vcam, and a better view of how the objects are positioned relative to each other. Remember: I need enough info to repro, so don't make me guess.

    If you'd like to DM me a small scene which reproduces the issue, that would be even better.
     
  5. jeromeisabelle

    jeromeisabelle

    Joined:
    Aug 29, 2018
    Posts:
    21
    Sorry, I didn't want to make you guess, I just thought it could be a common mistake. I've included the inspector of the main camera during the transition. Right now I can't reproduce the flickering problem for some reason, but the rotation y value changes from 180 to -180 every frame so I'm guessing the problem was occuring when it was changing from a value that's not 180
     

    Attached Files:

    Last edited: May 6, 2023
  6. jeromeisabelle

    jeromeisabelle

    Joined:
    Aug 29, 2018
    Posts:
    21
    The rest of the images.
     

    Attached Files:

  7. jeromeisabelle

    jeromeisabelle

    Joined:
    Aug 29, 2018
    Posts:
    21
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Thanks, that's very helpful.

    It's a precision problem that crops up when the camera has to rotate exactly 180 degrees in a blend. An easy workaround would be tweak the Y rotation of one of the cameras so that the difference is not exactly 180. Is that an approach that could work for you?
     
  9. jeromeisabelle

    jeromeisabelle

    Joined:
    Aug 29, 2018
    Posts:
    21
    Ah ok thank you. This solution could work for me, but I'm curious, isn't there a way to solve the problem at the root? Also, I might be wrong but the problem doesn't seem to happen when blending between two basic virtual cameras or when the freelook has no lookAt.
     
    Last edited: May 7, 2023
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    It's a precision issue in CinemachineComposer. Thanks for bringing it to our attention. Your clear repro case helped a lot. We will fix it for the next CM release.
     
    jeromeisabelle likes this.