I’m trying to get a camera to orbit around an object when I click and drag. I’ve modified the MouseOrbit script that comes with the Standard Assets to get the click detection to work using the condition:
if (Input.GetMouseButton(0)) {
transform.rotation = rotation;
transform.position = position;
}
The problem I’m having now is that when I click down, the camera immediately orbits on the first frame to some position which I’m guessing is calculated based on the mouse position during the click. This orbitting on click happens even with no mouse dragging.
Is there an easy way to modify the MouseOrbit script so I don’t get that initial jump in camera position?
Thanks.