The Follow and Look At targets are a pivot objects which follow the character via another script. Normally this pivot doesn’t rotate at all, but in the above video of the broken gravity flip, I’m trying to rotate it by 180 degrees around the Vector3.right axis (direction of the camera) for debug purposes. As you can see, the transition isn’t smooth.
Basically, I just want to be able to rotate the camera around it’s forward axis by some amount (usually 180 degrees) without it flipping out. Is there a better way to do this?
I like your general setup, with the floating CameraPivot - that gives you more control.
The problem I see is that using a FreeLook with LockToTarget binding, the camera won’t necessarily rotate in place, which is what you want it to do. Instead. imagine the surface defined by the 3 orbits, around the target, as being rigidly attached to the target, and the camera rigidly attached to a point of that surface, as determined by the current controller input state. Now you rotate the whole thing, which is what happens when you rotate the target, because LockToTarget binding means just that. The only way you’ll get the camera to stay put is to rotate the CameraPivot target along the camera-to-target axis.
However, that won’t give you the final rotation you want.
Probably what you’ll have to do is something like this: at the start of camera rotation event, activate a new vcam that you create dynamically at the exact position and rotation where the FreeLook is. Give it a higher priority than the FreeLook, and zero or very small blend time. Put DoNothing in Aim and Body. That means that there will be no procedural camera behaviour, and you will be able to manipulate the new vcam’s transform as you like. As the target flips over, rotate the new vcam 180 degrees along the vcam-to-target axis. When the flip is finished, deactivate the vcam, which will cause the FreeLook to blend back in. Make sure InheritPosition is checked on the FreeLook, so that it chooses the nearest point on its (now inverted) orbit surface.
I suggest also that you switch all the angular damping modes to Quaternion, to avoid gimbal lock.