Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Camera Transition: unwanted rotation

Discussion in 'Cinemachine' started by aesi_aes, Sep 24, 2023.

  1. aesi_aes

    aesi_aes

    Joined:
    Dec 16, 2013
    Posts:
    17
    Hello there :)

    I upgraded to from Cinemachine 2.9.7 to 3.0.0-pre7, and now I seem to have "the same" issue than in the old Cinemachine, which @Gregoryl 's script did indeed solve then...

    Code (CSharp):
    1. using Unity.Cinemachine;
    2.  
    3.     public class CinemachineIgnoreLookAtExtension : CinemachineExtension
    4.     {
    5.         protected override void PostPipelineStageCallback(
    6.             CinemachineVirtualCameraBase vcam,
    7.             CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
    8.         {
    9.             if (stage == CinemachineCore.Stage.Finalize)
    10.                 state.BlendHint |= CameraState.BlendHints.IgnoreLookAtTarget;
    11.         }
    12.     }
    As seen in this old thread:

    https://forum.unity.com/threads/iss...-rotating-during-a-blend.592783/#post-7156534

    Long story short, here you can see a video of what is happening:

    https://drive.google.com/file/d/1wUBWtu-th-ujrXG-LvXxQ7HkVYUTXplh/view?usp=sharing

    And here is the demo project... simply open "SampleScene", start it, and then activate "VirtualCamera (1)" to reproduce it... ( I know, in 3.0.0 it's now called "CinemachineCamera"... the name comes from the old project where it was fixed by the Extension ;) )

    https://drive.google.com/file/d/1pEAuWFBLFDt7POIGyp9Pe9r7fn2PCCi8/view?usp=sharing

    Thanks for any help :)
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    With CM3 you no longer need that script, as you can now choose IgnoreTarget directly in the blend hint.

    upload_2023-9-25_7-43-32.png
     
    aesi_aes and antoinecharton like this.
  3. aesi_aes

    aesi_aes

    Joined:
    Dec 16, 2013
    Posts:
    17
    Thanks! Works like always...

    Sorry for marking it as a bug ;)
     

    Attached Files:

    Gregoryl likes this.