I’m trying to smooth the rotation of my screen, which is controlled by the accelerometer. What is the best way, it’s working perfectly using this code (attached to the camera), which a member on here gave me…
float lateral = Input.acceleration.x;
float vertical = Mathf.Sqrt(
Input.acceleration.y * Input.acceleration.y +
Input.acceleration.z * Input.acceleration.z);
float angle = -(Mathf.Atan2 ( lateral, vertical) * 180.0f) / Mathf.PI;
camTransform.localRotation = Quaternion.Euler( 0, 0, angle);
but it’s very shaky. Does anyone know how I could stop it from being so shaky?