Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Cinemachine Priority : Confiner over Framing Composer ?

Discussion in 'Cinemachine' started by RemDust, Apr 3, 2018.

  1. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    431
    Hi guys, I'm pretty happy with my virtual camera setup so far :

    - framing transposer with a target group on multiplayer side scroller
    - camera confiner

    --> it works pretty well but for some reasons I sometimes need to "teleport" a player slightly outside the screen edge and it messes up the framing.

    I feel like the confiner should prevent my camera from showing these "outside" area but I guess it still tries to keep all the targets in frame.
    Is there any clean solution to give the confiner "priority over the transposer" to keep my camera in place ?

    First thing I can think of would be to temporarily taking off the player from the targets list but as I'm also using a zoom when targets are close from each other it would trigger an unwanted zoom on the remaining player...
    Any help would be appreciated here !

    Thanks guys :)
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,208
    In fact the confiner already has priority over the transposer. Something else must be happening to produce the problem effect.

    One thing to keep in mind: if you're trying to confine the screen edges to your game area, it's important to ensure that the camera frame will always fit inside the playing field. If the ortho size is large enough to produce a screen frame that's larger in any dimension than the playing field at that spot, then the confine algorithm will fail and the camera can go out. Could that be what's happening?
     
    RemDust likes this.
  3. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    431
    That was the issue, thank man ! ;)