Search Unity

Cinemachine camera forward not updating[solved]

Discussion in 'Cinemachine' started by chelseysmith, Apr 25, 2019.

  1. chelseysmith

    chelseysmith

    Joined:
    Jun 14, 2018
    Posts:
    3
    Hi,
    I recently added Cinemachine into my project and I am getting a side-effect.

    When the Cinemachine brain is enabled the cameras Forward, Right and Up vectors are not being updated as the camera moves. This causes my character controller to behave incorrectly.


    //camera variables
    [SerializeField] Transform Camera;
    [SerializeField] CinemachineFreeLook VCamera; <- tried this after first failed to work

    //testing the vectors
    Debug.Log($"VCamera Forward: {VCamera.transform.forward}");
    Debug.Log($"Camera Forward: {Camera.forward}");

    The resulting output during each frame is the same vector at startup, even as the camera moves about the scene.


    Any help would be appreciated.


    Thanks,
    Chelsey
     
    Last edited: Apr 26, 2019
  2. chelseysmith

    chelseysmith

    Joined:
    Jun 14, 2018
    Posts:
    3
    Figured it out.

    The SimpleCameraController script that comes with the LWRP project was holding onto the camera. Removing it from the camera solved my issue.
     
  3. wechat_os_Qy0wFedZx_5kWJD0W_0QJCBls

    wechat_os_Qy0wFedZx_5kWJD0W_0QJCBls

    Joined:
    Oct 29, 2022
    Posts:
    1
    Thank you for sharing this! It just helped me out greatly!