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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Resolved Boxing Fight Camera

Discussion in 'Cinemachine' started by marios_chr, Mar 26, 2021.

  1. marios_chr

    marios_chr

    Joined:
    Nov 24, 2020
    Posts:
    3
    Hello everyone, I'm new with Cinemachine and I'm trying to create a vcam that works like the UFC games. An example: Link

    I have a Target Group with the two fighters and for Aim I use Group Composer, but I don't know what to use for Body to always keep the camera at the side of the fighters when they make side steps. I tried changing by script the Body Heading Bias based on the angle that's created by the two fighter transforms but it's not smooth and I'm sure it's not the correct way to do it.
     
    Keyzdagamer likes this.
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,238
    I would keep the target group for the aim, and create an invisible object to use as a Follow target. Have a custom script on the follow target position itself at the average position of the fighters, and orient itself to always face in a direction perpendicular to the line joining the two players (i.e. it always faces to the side). Use a Transposer in the Body, with LockToTargetWithWorldUp Binding Mode. You can have some angular damping to soften the movement.
     
    Keyzdagamer likes this.
  3. marios_chr

    marios_chr

    Joined:
    Nov 24, 2020
    Posts:
    3
    Gregoryl likes this.