Search Unity

Camera Problems When Adding More Than 2 Targets

Discussion in 'Cinemachine' started by GreenHorn81, Jan 4, 2022.

  1. GreenHorn81

    GreenHorn81

    Joined:
    Mar 12, 2020
    Posts:
    3
    I setup a target group from cinemachine for a simple platformer. If I have only two targets everything works fine. If I add a third target things get weird. I've searched high and low and can't seem to find anyone else that's come across this issue and the tutorial I'm following doesn't have a problem when adding a third target.

    When I click the plus sign, the camera rectangle in Scene View extends to the left. When I put in a game object into the third slot the camera rectangle in Scene View goes 3D and extends out on the Z axis. From there when I hit play the camera then rotates on the X and Y axis when I move the player. Makes me a bit sick to when I play like that. I cannot reset the rotation transform to 0. The numbers automatically jump back to whatever value is in there. When I remove the third target, the camera rectangle goes back to a regular 2D rectangle and the camera no longer rotates.

    I've tried messing with everything in the inspector but when I do things that stop the camera from rotating with three targets causes the camera to stop following targets. Pretty much making the target group and cinemachine pointless. I do not know what to do about this and like I said earlier, I've been unable to find anyone else that ran into this problem.

    Furthermore, I have had this problem more than once with different Unity versions on two different laptops. I've tried uninstalling and reinstalling. Nothing seems to work and I always get this problem. Can anyone out there help with this? It's driving me nuts and I've become hung up on this issue and it's preventing me from moving on. Below are screenshots of what I tried to explain.

    EDIT: I'm using Unity 2020.3.14f1 Personal

     
    Last edited: Jan 4, 2022
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Could you show the transform of each GameObject (Player 1, Player 2, Fly)?
    I think, Fly's z axis value is different from Player 1 and Player 2.

    Also, have you tried Position Mode: Group Center?
     
  3. GreenHorn81

    GreenHorn81

    Joined:
    Mar 12, 2020
    Posts:
    3

    Fly Transform


    Player Transform


    Player 2 Transform


    Group Center and the camera still rotates.

    Also, thank you for replying and taking a look. I appreciate it a lot!
     
  4. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    These look ok.

    Could you show you Body and Aim components on the vcam?
    Maybe, your camera is trying to look from the side. For example, Transposer offset is not 0,0,-10, but instead something like x, y, -10.
    In this case, the camera is not going to be parallel with the plane on whichs the targets reside:
    (transposer offset is 3, 0, -10)
    Screen Shot 2022-01-06 at 2.55.56 PM.png

    (transposer offset is 0,0,-10)
    Screen Shot 2022-01-06 at 2.56.02 PM.png
     
  5. GreenHorn81

    GreenHorn81

    Joined:
    Mar 12, 2020
    Posts:
    3
  6. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    It is difficult to say what might be causing your issue. Could you send me a project where I can reproduce the issue? You can send me a direct message.