How to Use Cinemachine Confiner with Multiple Rooms in Additive Scenes?


have a question regarding the use of Cinemachine Confiner with multiple rooms in additive scenes. Things worked when the level was in the same scene, but when I tried to use additive scenes, something seemed wrong. I have a persistence scene that contains a camera, Cinemachine, player, and game manager. This scene will not be destroyed (it only contains the protagonist and some inherent data). New level scenes (each containing multiple room game objects, with each room having enemies and maps, and each room having its own PolygonCollider) will be added additively. I want to know how to use Cinemachine’s Confiner in this situation to ensure that my camera can follow the protagonist while using the PolygonCollider of different rooms. As shown in the screenshot, I directly added the PolygonCollider from the level and got a mismatch error. Does Confiner not support cross-scene usage? Or is my approach wrong from the beginning?

My bad, it’s because I didn’t know that cross-scene references are not allowed in edit mode but are allowed at runtime. I was manually testing by dragging and dropping in edit mode.Everything is ok now, finally plan use confiner bind a composite collider, and set all level room object as the composite collider’s children, and add trackerPlayer script on the virtual camera, everything is ok now

1 Like