Hi,
My camera is working the way I want it to, but when I start the game, my click-and-drag camera activates for a fraction of a second causing the camera to appear to jump. It seems like the if statement shown below fails to exit this function before the camera is moved.
The only thing I could think of to stop it is to quit the function until a little time passes.
private void PanDolly()
{
// Quit if the left mouse button isn't held down
if (!Input.GetMouseButton(0)) return;
// This is a bug workaround. If this update runs too soon at the start
// of the game, the mousebutton check above will be fooled and
// this script will be active for a moment causing the
// camera to jump unexpectedly.
if (Time.time < 0.3) return;
float mouseX = Input.GetAxis("Mouse X");
float mouseY = Input.GetAxis("Mouse Y");
Debug.Log(Time.time + " - " + mouseX + ", " + mouseY);
// Do camera stuff here....
}
This version, which includes my workaround, is totally stable. I just hate hacks.
Any ideas?