Search Unity

Question Unity 2022.2 Weirdness with static camera and Timeline?

Discussion in 'Cinemachine' started by metaphysician, May 23, 2023.

  1. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    hey folks just checking in here on using Cinemachine Vcams with Timeline when they are NOT pointing at anything and just a static cam. there's seems to be some very weird behavior on my end, where i basically cannot set a a transform for a static camera that doesn't follow anything. if everything's set to 0,0,0 for position it's fine, but any change from that in value and it regards it as some kind of momentum vector and will continue moving that direction perpetually by itself. so if you set Z at say .5 it will slowly zoom out by itself and never stop.

    the only way i've been able to stop this is by having it follow a static object but of course that comes with its own issues.

    i'm going to try a new blank project in Unity 2022.2 and see if i can reproduce the behavior, as this project was upgraded from an earlier Unity version (2021.3.25) and had an older Cinemachine installed. i did upgrade Cinemachine, but perhaps it needs a fresh install.

    any thoughts appreciated!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    Can you show the inspector of the vcam in question?
     
  3. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    okay @Gregoryl i just tested this with a blank project, installed Cinemachine from scratch and the results are exactly the same. here's a test:

    https://www.dropbox.com/s/8tg7lljqxt33127/cinemachineIssue.mov?dl=0

    i had two cameras set up, one with 3rd person follow called 'FollowChar', one that is static called 'Static' but i had to set it up with 3rd person follow, and then switch it to Do Nothing for Body at around 35 seconds. then i switch to the static clip and adjust the position, and scroll the playhead on the Timeline. notice how the 'static' camera just recedes infinitely into space and ONLY resets when the playhead goes over the FollowChar block. it will work in a somewhat similar way just in the Scene view and moving the camera via translate - it will continue to move as long as i have the mouse in the scene window. rotation seems also to work the same way.

    seems like an Editor bug to me. setting the static camera to follow and look at nothing doesn't work either. and i just noted that in the Inspector as the camera moves back that the transform position doesn't update at all or only updates position briefly and then stops. so it thinks it's staying in place but its physically not. it's tricky trying to show this in a screenshot, but hopefully the video helps.

    scott
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
  5. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    @Gregoryl yeah i think this is a pretty substantial bug. here you go:

    https://www.dropbox.com/s/h83tmp80tdm0gby/testCineCamera.zip?dl=0

    just for clarity, if you set the position/rotation of the static cam to anything other than zeros for everything it will regard that value as a movement or rotational movement constant and continue moving/rotating along those axes based off the value.
     
  6. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    okay i think i realized my error - i put the virtual cams under the Cinemachine Brain Main Camera object, but i seem to remember doing this before and not having issues. but after moving them out of being children of MainCamera/Brain, it does seem to behave much better and more predictably. i guess it somehow feedbacks the transform information to the Brain when its a child and makes everything go haywire. weird. sorry for the noise, but i'm glad i didn't label it as a bug anyway!

    scott
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    Yes, that's exactly right. You had a feedback loop. The main camera should be an independent gameobject, not in the parent hierarchy of the vcams or the vcam targets.
     
    metaphysician likes this.