I’m in the making of a simple endless game where I use Cinemachine.
My problem is that - as endless games require - I occasionally revert the position of the player and the environment to avoid going to high float values.
I do have damping on my camera’s X which causes a noticeable “popping” in the otherwise seamless revert.
How could I avoid this popping?
Here’s what I code, pretty simple:
Note I messed around with the cam a bit after the post so it isn’t exactly the same but the popping effects remains. @Gregoryl Did I post the info you needed?
Yes, the popping effect will remain so long as you have damping. You can’t just poke the Unity Camera’s position, because it’s 100% controlled by the vcam, so your value will be immediately overwritten.
We need to add an API call in the vcam to apply the delta to both the camera and the damping data. There’s no other way to get it to work. I’ll see if I can throw together a patch for you. Is this your only vcam?
Yep, only Vcam. How to make that API call? Edit: and only camera in the scene. Edit again, the “we” in “we need to apply…” refers to you at unity, or you and I? sorry, not a native speaker, got confused xd.
We’ve had similar issues where we needed to position and rotate the camera because of seamless portals connecting with other parts of the level. Have not been able to get it working if there is an active blend occuring during the teleportation or if recentering is enabled on the active vcam.
I have a fix for the repositioning of a camera, but rotation is a little trickier. Can you give a little more info about your situation? A sample project would be great.
Sorry took apart some stuff in the project Right now it doesn’t have the “teleport back” feature. However, It doesn’t rotate the camera, it’s fix always. It only tracks the movement of the player, the rotation of the cam is the same always.