Hi Gregory, thanks for the quick and detailed reply! Didn’t have much time the last day or two, but I’ve been tinkering with it here and there.
The vcam changing position problem resolved itself after restarting Unity (should’ve done that first).
As for the out of view frustum error, I was using an extension to do a floating origin snap during the body stage callback, which was probably bad and wrong and messed up Cinemachine’s flow. I basically wanted to move → snap → orient. I was avoiding OnTargetObjectWarped because I didn’t realize it forced an immediate position change, which was exactly what I needed (almost like it was designed for cases like this!!)
So the initial issues are resolved, however I am still getting some jitter. It’s a rough solar system simulation so the movements are large. The process goes like this now:
Update:
UpdateData() //Stored as doubles with a local and global position
UpdateTransforms() //Converts data into world position for Unity
LateUpdate:
TrySnap() //Runs when camera is reacting to celestial body movement
brain.ManualUpdate()
TrySnap() //Runs when camera is the cause of movement (user input, prevents out of view frustum error)
I’m still using ManualUpdate (SEO 90, the brain immediately follows at 100) just so I can more easily wrap it in TrySnaps (which just snaps as long as the camera moved far enough). I’m avoiding using events just because Unity seems to like giving out of view frustum errors unless it’s timed exactly like this.
Anyway, here’s a video of me enabling and disabling the “Pre Cine Snap” and how it affects the jitter (the object is following an orbital path where it moves 1e10+ each frame):
Kinda hard to see, but with it enabled, it’s aligning with the center of the object perfectly (which is the center of the hexagonal shape closest to the camera), but it’s not at the exact right location, and so it orients itself differently each time as well. It seems like a floating point error but the vcam gets put back near origin before the ManualUpdate. When the simulation is stopped, it ends up at the intended position and orientation. There’s no damping, either.
These are logged directly following each brain.ManualUpdate(). Also the “Vcam Offset” means its expected value, aka its settings.
Anyway, I rambled a lot and now I realize this may not even be a Cinemachine related question anymore, so I can mark this resolved and make a new post if you want. In any case, thanks for your help!