camera and acceleratometer

Hi
I want to rotate the camera as much as my phone acceleratometer is tilt
my camera will be fixed at one position
only it can rotate in the direction of accleratometer tilted in xy plane

this code doesnt stops it at an angle of tilt keeps on rotating it

void Update ()
{

float hRotation -= Input.acceleration.y * cameraMovementSpeed;
float vRotation += Input.acceleration.x * cameraMovementSpeed;

transform.rotation = Quaternion.Euler( hRotation,0.0f,0.0f);
}

please help

Your code incremented the rotation values every frame. Get rid or +/-.

void Update ()
{


float hRotation = Input.acceleration.y * cameraMovementSpeed;
float vRotation = Input.acceleration.x * cameraMovementSpeed;

transform.rotation = Quaternion.Euler( hRotation,0.0f,0.0f);
}

Best regards,
Peter.