Search Unity

Bug Cinemachine constantly rotating

Discussion in 'Cinemachine' started by Bigmautone, Jun 6, 2023.

  1. Bigmautone

    Bigmautone

    Joined:
    Oct 5, 2020
    Posts:
    5
    Hi everyone,
    I'm trying to implement a camera system similar to the one in "Dead by daylight", where you can look behind you. For doing it, i set up 3 virtual cameras and, with a button press, i can activate a transition from the main pov camera to the other one selected. I placed 2 empty objects over the "shoulders" of my player and, if i set the follow property on them, the camera is following the player movement right. The fact is, when i set up the aim as "Same as follow target" and activate one of the 2 shoulder cams, they start to rotate constantly.
    Here a video of the problem and some screenshot of the settings:
    upload_2023-6-6_22-4-23.png upload_2023-6-6_22-4-52.png
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Your CM setup looks fine. The problem is likely in your player motion controller. Because the shoulder cams are rear-looking you don't want to rotate the player to face camera forward while they're active.

    Instead of the POV behaviour, I would recommend that you make an invisible object for the head, and that your controller should rotate that and process player movement according to the rotation of that object. Then, for the POV camera, just use another "Same as Follow Target" behaviour on the rotation instead of the POV, and use the head as follow target.
     
    Bigmautone likes this.
  3. Bigmautone

    Bigmautone

    Joined:
    Oct 5, 2020
    Posts:
    5
    Hi Gregoryl,
    Thanks for your answer! I will give it a try and i'll let you know if it works!
     
    Gregoryl likes this.