FloatingOrigin, Cinemachine and Camera Shakes

Hello everyone!

I tried using floating origin script with a basic cinemachine setup

- Attached the FloatingOrigin.cs to main camera.
- Main Camera with a CinemachineBrain and a GameObject with a virtualCamera Component made to follow and aim at the player.
- Virtual Camera has a Transposer component and a Composer component

https://vimeo.com/508889198

By this mere setup, Floating Origin does function just fine and also does the Cinemachine (No Doubt) However it is the interpolation performed by the cinemachine on following a target gives jittery and glitchy visuals while resetting transforms over threshold.

By Reducing Damping to 0 on Virtual Camera’s Transposer, gave the desired result. (Which is no jitter and smooth transition - the perfect illusion promised by the floating origin script.)

I tried several attempts to achieve the desired result with Damping on by adjusting

  • RigidBody’s Interpolation
  • CinemachineBrain’s Update Method and Blending Update method
  • Transposer Damping
  • Script’s Update

Had failed So Far…
I don’t know if the community has any solutions? or is it how it is - cant be resolved.
I would be very glad to learn.

You need to call vcam.OnTargetObjectWarped, which informs the vcam that the coordinates of the target it’s tracking have suddenly changed, but you want to keep smooth tracking across the transition.

This post might help: Reposition target and camera runtime - how to avoid the "popping"?

1 Like

This works Just fine!
vcam.OnTargetObjectWarped made all the difference, Many Thanks, Gregoryl.

2 Likes

Hi

Hello,

Once you apply this, does it get set right away or after few frames? I am trying to do the same thing and it mostly works but every so often it jumps or so jumps (like in the video of this thread). As mentioned here, if I set the damping to 0 it works fine. Any advice would be appreciated, thanks!

7889917--1004164--upload_2022-2-11_13-56-28.png

Here is a video of what happens. It almost looks like, some times it doesn’t listen to that method call. Note that I have it set to reset at every 10 units, for testing purposes. It does happen at larger distances too. Also, ignore the last bit where it spins around.
https://www.youtube.com/watch?v=b4ZAghJbPCE

This should not take a few frames. If you call OnTargetObjectWarped() at the same time as when you move the target, it should take effect immediately.

What version of CM are you testing with?

using update method: lateupdate in the CM brain helped for that in one project.
(otherwise there was clearly 1 frame delay or so)

1 Like

Hi, I am on 2.6.11. However, it seems something else might be causing this stutter, it is just super imposed with cinemachine’s damping. I will be digging more into this in the next few weeks and will share if I find anything new. Thanks.

1 Like