Hi Anthony,
Those worked great, thanks!
I just needed to make one little adjustment to it, and been having some trouble figuring out how to implement it within the TouchCameraPro libs....
Suppose the perspective camera is in Rotate Around mode, looking down at a 45 degree angle. When I execute RelocateCameraInstant and put it into Rotate Head mode, it repositions the camera to the focal point, which is great. But the angle after the camera was relocated is still at the 45 degrees (which makes sense), but I need it to now be looking in the same direction but parallel to the floor, not at the floor at 45 degrees. I attempted several mods to adapt this behavior into the method:
`public void RelocateCameraInstant(Vector3 targetCamPos, Quaternion targetRotation)
{
finalRotation = targetRotation;
//Vector3 euler = FinalRotation.eulerAngles;
//Vector3 yawOnly = new Vector3(0, euler.y, 0);
//finalRotation = Quaternion.Euler(yawOnly);
finalPosition = targetCamPos;
finalOffset = CalculateOffset(finalPosition, finalRotation);
finalDistance = CalculateDistance(finalPosition, finalRotation);
//finalRotation = targetRotation;
ApplyToCamera();
}`
The idea was to pass a Quaternion that contained the same direction as the current rotation, only parallel to the ground. But this has not worked in the few different ways that I tried. Is there a problem with the code, or do you think there is a problem with the Quaternion I am passing in? If the former, please let me know the adjustments I should make. If the latter, how would I then derive the quaternion of the existing rotation but be parallel to the ground and not looking at the ground?
Thank you!