Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Video 3D camera jitter on rotation

Discussion in 'Audio & Video' started by kai_226, Oct 28, 2019.

  1. kai_226

    kai_226

    Joined:
    Jul 6, 2017
    Posts:
    53
    Hello community,
    I know this subject has been discussed many times, so I will try to be as accurate as possible.

    I have a camera that follows a rigidbody object. The camera is not a child of the RB object. With my current setup I didn't have much jitter problems except when only rotating the RB object [by force].

    First of: Here is a video of a simplified version of my game. You will notice two things:
    1] Random jitter when accelerating
    2] Jitter when rotating the object


    I haven't had the first problem before, only in one specific scene although the scene is much simpler than any others, but I assume [or hope] it has to do with the rotation problem.

    Now for my setup:
    My Fixed Timestep in my project is set to 0.01!

    This is the RigidBody of my 3D object that I am moving, it also has a box collider:
    https://imgur.com/EdHkawV

    This is the movement script of the object [simplified to the core mechanics]:
    https://pastebin.com/JfxYYskh

    The camera also has a RigidBody and a collider as the camera can be detached from the target and will then fall down [not so important now]:

    https://imgur.com/wh1ZT0w

    And here is the simplified camera script:
    https://pastebin.com/Fwd8LUhe

    What I have tried:
    - Of course I removed the collider and rigidbody from the camera for testing but then the ship jittered even more.
    - I tried using FixedUpdate() or LateUpdate() for my Follow() method in the camera script. The results were either equal or worse.
    - I played with the Interpolation settings on the RigidBodies of both my camera and the 3D object. Again, the results were either the same or worse.
    - It's exactly the same result, no matter if tested in Unity or with a build.

    I also watched tutorials or read in several forums but I haven't found the ultimative solution yet so I hope you guys can help me.

    If nothing helps, I can live with problem 2] as it doesn't look so nice but is only a minor issue but 1] is a showstopper and I don't really know what I can do about it.

    I hope my post contains enough info, if anything is missing, please let me know! Thanks for every helping brain in advice :)
     
  2. kai_226

    kai_226

    Joined:
    Jul 6, 2017
    Posts:
    53
    Ok, I found the problem with the big showstopper jitter: It only happens when having the script "Photon Transfrom View" attached and activated on my 3D object [from Photon Networking].
    No idea what is causing this issue here as it works fine in other Scenes. But at least I can work with that now and try to find a solution so I can get this scene Multiplayer-ready aswell.