Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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:
    7,658
    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