Search Unity

Bug aim/POV turned into aim/do nothing if POV is set to enable=false before ForceCameraPosition IN-20023

Discussion in 'Cinemachine' started by laurentlavigne, Oct 16, 2022.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    upload_2022-10-16_13-22-19.png

    Code (CSharp):
    1.         GetComponent<CinemachineVirtualCamera>().GetCinemachineComponent<CinemachinePOV>().enabled = false;
    2.                 GetComponent<CinemachineVirtualCamera>().ForceCameraPosition(positionNearFollowCamOrbit, spaceVCAM.transform.rotation);
    3.  
    4.  
    = aim turns to
    upload_2022-10-16_13-24-15.png

    should be
    aim remains to POV


    until this is fixed, i need to deactivate POV, how do i do that without it breaking?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Does it actually go away, or is it just wrong UX?
    You can check by trying to enable it again. If that works, then it's still there.
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    POV is gone and nullrefs the bit of code that disabled it
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    CM Doesn't support enabling subcomponents this way.
    The correct way would be to have 2 vcams: one with POV and one without. Activate the one that's needed.
     
    Last edited: Oct 18, 2022
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Which means extra scaffolding.
    It shouldn't auto clean components. That's very un-Unity like.
    Any other way to turn off user input on POV?
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    We agree. Cinemachine 3.0 (to be pre-released in November) addresses this and many other such legacy issues.
     
    laurentlavigne likes this.
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Looking forward to it. Any eta for the preview version?
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    November. But the minimum Unity version for it will be 2022.2.
     
  9. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Ouch.
    2022.2 broke a few vital things and no sign of fixing them, any chance you lower the barrier of entry?
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    No, unfortunately. Don't worry, we will continue to support CM2, so you won't have to upgrade Unity if you don't want to.
     
  11. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    what's the feature of 2022 you use in 3.0 that's not in 2021?w
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    A few of them. A big one is Unity Splines.
     
  13. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Spline to define camera position search space?
     
  14. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Instead of CM's custom spline implementation for camera paths, we are using the new Unity Splines.
     
  15. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Then why not just add a few conditional compile to support older builds. That's what so many single devs making assets on the store sweat to do so I'm sure your team can manage.
     
  16. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    There are limits to how much we're willing to complexify the code. Sometimes it's better to make a clean break. There is already a lot of conditional compilation in CM, supporting Unity all the way back to 5.x. No one is forcing you to move to CM3; you are welcome to stay on 2.X if you're not comfortable upgrading Unity.