- Home /
Smooth camera rotation on mobile and pc when GetMouseButton()?
I wrote this script here. It's working, but it's a little bit jerky on mobile device. How can I make it smoother?
camRotation.x = Input.GetAxis("Mouse X");
camRotation.y = Input.GetAxis("Mouse Y");
if (Input.GetMouseButton (0)) {
camRotation.x *= rotationSpeed.x;
camRotation.y *= rotationSpeed.y;
camRotation *= Time.deltaTime;
transform.Rotate( 0, camRotation.x, 0, Space.World );
transform.Rotate( -camRotation.y, 0, 0 );
}
And when it's possible, I want, that the camera rotates slowly or fast depending on the swipe distance.
Comment
You could try using FixedUpdate()
ins$$anonymous$$d of Update()
, if you're already not @jazib27
Your answer
Follow this Question
Related Questions
Help, please with rotation input 0 Answers
Wonky Camera Behaviours 0 Answers
"Perfect" Free Rotation Method? (like Blender) 2 Answers
Rotation always changing values! 1 Answer
Mouse Orbit snapping issues 0 Answers