Search Unity

Cinemachine Confiner not updating when changing BoundingShape2D

Discussion in 'Cinemachine' started by ryanas, Jul 28, 2019.

  1. ryanas

    ryanas

    Joined:
    Oct 2, 2013
    Posts:
    14
    When moving between levels, I update the BoundingShape2D of my CinemachineConfiner dynamically to the one provided by the level.

    This does not seem to work however and the confiner seems to be broken until I remove it and re-add the extension and manually attach the BoundingShape2D again.

    I've seen many posts mention using InvalidatePathCache() but it doesn't seem to do anything.

    I'm using it like this

    Code (CSharp):
    1. _cmConfiner.m_BoundingShape2D = level.cameraBoundingShape;
    2. _cmConfiner.InvalidatePathCache();
    Using Unity 2019.1.7f1 with Cinemachine 2.3.4
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    5,312
    That should work. InvalidatePathCache() should be enough.

    If it doesn't work properly, would you mind putting together a minimal project that demonstrates the problem, and logging a bug?

    Thanks
     
unityunity