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

Question How to keep follow targets within camera frame?

Discussion in 'Cinemachine' started by Ahmadhp, Mar 25, 2021.

  1. Ahmadhp

    Ahmadhp

    Joined:
    May 31, 2013
    Posts:
    33
    Hi,

    For an co-op action-RPG game (minecraft dungeon like), I have a camera looking down with 45 degree angle.
    Camera is following the players character with "Framing Transporter" mode and no Aiming and when the players getting away from each other camera pulls out based on the max distance defined.

    The problem is while camera is following the center of the follow target group, because of that 45 degree angle character's don't have the same distance from the top and bottom edges of the screen.

    For now I was able to correct that by increasing the target's weight (targets that are at the bottom of the screen), but was wondering if there is another and maybe a better way of doing that.

    thanks
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Your solution seems good. Is it causing problems?
     
  3. Ahmadhp

    Ahmadhp

    Joined:
    May 31, 2013
    Posts:
    33
    No, was just wondering if there is a better way of achieving that :)
    Like an option that when one of the targets is at the edge of the soft zone and no pass area prevents that target to enter the no pass area until the other target hasn't touched the soft zone and no pass area.

    thanks for answering