Search Unity

Camera Jitter, depending on the settings either the player or the environment jitters

Discussion in 'Cinemachine' started by SirWhiteBeard, Feb 4, 2020.

  1. chaosmonger

    chaosmonger

    Joined:
    Jan 23, 2019
    Posts:
    71

    Of course it's not there, as I said I've tried putting there with values 101, 401, 600, etc... and it was messing things, so I removed it.
    I'll dig into the dependencies... but the script is the one I posted above.
     
  2. chaosmonger

    chaosmonger

    Joined:
    Jan 23, 2019
    Posts:
    71
    Update... @Gregoryl you were right, but I needed a tweak.
    Basically putting the ParallaxElement after the CinemaBrain was working, BUT at start of scene all my items weren't placed in their correct position (i.e. they were left as if the Parallax wasn't active, and then started to move later on). That's why I said everything was messy. Because since the Parallax Script was starting after the camera moved to the player, all the objects with Parallax were in the original camera position (the default one, 0,0,0, and not the one of the player at start, which can be in different points of my scene according from where the player is coming from).
    I solved creating a new script called InitializeParallax, which call the "ProcessParallax" at Start of each ParallaxElement objectsOfType, so they are placed correctly, and then work smoothly!
     
    Gregoryl likes this.
  3. alti

    alti

    Joined:
    Jan 8, 2014
    Posts:
    94
    It has to do with the "target look" at with cinemachine. For timeline, because nothing in this engine is ever easy, you'll just have to aim the camera manually. Has anybody had success with target look at using a prefab's object? I also tried looking at an unparented smooth follow object, and that had jitter issues as well.
     
  4. lmantock

    lmantock

    Joined:
    Feb 25, 2018
    Posts:
    4
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    You have to assign the vcam's target lookat to the prefab instance. Since that instance only exists at runtime, you need to do it via script.

    There is no obligation to aim the timeline vcam manually. Procedural aiming works just fine. What exactly were you unable to implement?
     
  6. alti

    alti

    Joined:
    Jan 8, 2014
    Posts:
    94
    I fixed the jitter by updating the update method to late update on the cinemachine brain. fixed update caused the jitter for me.

    I'll keep it in mind, but yeah, i assumed in a different thread the jitter had to do with looking back and forth at the base animation object position and the new object position from the overridden animator timeline. so setting the target at runtime makes sense, just kinda silly to not respect it at default.