Search Unity

Freelook X axis recenter wait time not working?

Discussion in 'Cinemachine' started by Flobee, Aug 5, 2019.

  1. Flobee

    Flobee

    Joined:
    Dec 28, 2018
    Posts:
    2
    Hello,

    I've just recently started tinkering with the Cinemachine cameras and I've run into an issue that I can't seem to get past.

    Have a freelook camera looking and following my player character. Y-Axis Recentering is working properly but "Recenter to Target Heading" which as I understand it would be the X-Axis Recentering is ignoring my Wait Time field. It will immediately recenter the screen when I stop panning the camera.

    upload_2019-8-4_18-7-29.png

    I'm using the below code to pan the camera

    Code (CSharp):
    1.     void Update()
    2.     {
    3.         if (Input.GetMouseButton(0))
    4.         {
    5.             freeLook.m_XAxis.m_InputAxisName = "Mouse X";
    6.             freeLook.m_YAxis.m_InputAxisName = "Mouse Y";
    7.         }
    8.         else
    9.         {
    10.             freeLook.m_XAxis.m_InputAxisName = "";
    11.             freeLook.m_YAxis.m_InputAxisName = "";
    12.  
    13.             freeLook.m_XAxis.m_InputAxisValue = 0;
    14.             freeLook.m_YAxis.m_InputAxisValue = 0;
    15.         }
    16.     }
    Unity 2019.20f1
    Cinemachine 2.3.4

    Recentering starts immediately when I stop moving mouse even if button is still held down. If I disable Recenter to Target Heading things work as I would expect.

    Thanks for the help
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Yes, it's a bug that was fixed for CM 2.3.5, available now in preview
     
  3. Flobee

    Flobee

    Joined:
    Dec 28, 2018
    Posts:
    2
    I'll check it out. Thank you!
     
  4. maynardhearns

    maynardhearns

    Joined:
    Oct 11, 2021
    Posts:
    2
    heya! I seem to be running a similar issue with CM 2.8.9--it appears the "Wait Time" values on both Y-axis and X axis/ "Recenter to Target Heading" are not working, however, like OP, when I disable the boolean, I run into the same issue. For now, going to try putting in a work around that enable/disables the bool after wait time.
     
  5. maynardhearns

    maynardhearns

    Joined:
    Oct 11, 2021
    Posts:
    2
    Forgot to add my screenshot!

    upload_2023-12-6_10-29-8.png
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Try upgrading to CM 2.9.7