Hi,
I am using a script for a 360 camera using touch controls for 360 panoramas and video. The touch is functioning almost as desired, but the camera rolls a bit when I pan around. How can I lock the roll of a camera in Unity?
Hi,
I am using a script for a 360 camera using touch controls for 360 panoramas and video. The touch is functioning almost as desired, but the camera rolls a bit when I pan around. How can I lock the roll of a camera in Unity?
// touch panning
else if(originator == Originator.TouchDevice)
{
if(!invertTouchVertical)
{
panoCamera.transform.Rotate((-finger1.deltaPosition.y * touchPanSpeed * Time.deltaTime), 0, 0);
}
else
{
panoCamera.transform.Rotate((finger1.deltaPosition.y * touchPanSpeed * Time.deltaTime), 0, 0);
}
if(!invertTouchHorizontal)
{
panoCameraPivot.transform.Rotate(0, (finger1.deltaPosition.x * touchPanSpeed * Time.deltaTime),0) ;
}
else
{
panoCameraPivot.transform.Rotate(0, (-finger1.deltaPosition.x * touchPanSpeed * Time.deltaTime),0) ;
}
}