Freelook camera gets stuck

Im trying to implement RTS style camera with freelook. I created target object for camera to follow, camera set to be “behind” it. Object moving and rotating with script by pressing WASD and right mouse button. Only Yaxis contlrolled by Cinemachine with mouse scrollwheel.

Everything works like a charm, you can see on screen 1 - camera always stays behind the cube.
BUT. When I am moving and rotating target object at the same time, sometimes camera does not recenter itself on X axis, resulting in look at the side of cube (screen 2). Only if I rotate object once more, camera updates its position and get behind cube as expected. Here are screens and CM settings.


(Correct position)


(Camera stuck. As you can see, X axis value stays zero)


Hi,
I’d like to suggest an other approach to create an RTS camera. Instead of Freelook, try using a virtualCamera with Framing Transposer in Body, and Do Nothing in Aim. See the attached RTS.png image.

With this setup, you can easily position your vcam the way you want. To position your vcam, change the vcam’s transform.rotation x and y values and the Camera Distance parameter on FramingTransposer.

To rotate around your target, simply modify vcam’s transform.rotation.y value.

On the attached Parameters.png image, the x and y represent the transform.rotation.x and y values, the sphere’s radius is the Camera Distance and your target is at the center of the sphere.


6753523--779101--Parameters.png

Thank you, I will try to apply the method you suggested!