Search Unity

Cinemachine not tracking in 2D

Discussion in 'Cinemachine' started by StormcloudArts, Dec 2, 2021.

  1. StormcloudArts

    StormcloudArts

    Joined:
    May 23, 2019
    Posts:
    11
    Hi all,
    I am following the tutorial on Udemy to make a Stardew Valley style game. It was going fine, but yesterday I updated to the latest version of unity. Now, when I run the game, the cinemachine camera TRIES to follow the player but instantly snaps back to the original camera view. I have tried removing the camera, downloading the latest cinemachine in package manager and redoing it, but got the same results. I am not a unity pro, and am at a loss to how to fix this. Just fyi, the problem didn't start immediately after upgrading, the game ran once or twice without issues.

    I have attatched my camera and cinemachine camera settings.

    Can anybody help?
     

    Attached Files:

  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    I doubt that the problem is within Cinemachine itself. If you open your project with the old version of Unity, does the problem go away?
     
  3. StormcloudArts

    StormcloudArts

    Joined:
    May 23, 2019
    Posts:
    11
    Hi! I tried downgrading to an older version, but the project would only load in safemode, and the scripts were a sea of errors. I put it back to the new version, and it works, but the problem with the camera is still there, of course!
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    It's good practice to make a backup of a project before upgrading Unity, precisely for reasons such as these. What are the old/new versions of Unity, and what are the versions of CM?
     
  5. StormcloudArts

    StormcloudArts

    Joined:
    May 23, 2019
    Posts:
    11
    Thank you Gregoryl. I learned a lesson about backing up today!

    My Unity editor version is 2021.2.4f1 now, and had been using 2021.1.3f1

    for Cinemachine I am using 2.8.3 and had been using 2.8.0 (but the problem was there before I upgraded)

    thank you
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    As I said, with those versions of CM there should not be a problem such as this. I suspect that the issue lies deeper in your project code. You're just going to have to debug it.
     
  7. StormcloudArts

    StormcloudArts

    Joined:
    May 23, 2019
    Posts:
    11
    So, this is embarassing! It was neither the editor version, or the cinemachine. SOMEHOW I had managed to create a copy of the cinemachine camera (which lives in the persistant scene with the player and game managers) and copy it to Scene1 where the scenery tiles and game items are. Embarassing! :D
     
    Gregoryl likes this.
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Glad you found it. Focus on that and don't be embarrassed :)