How to create tilt control similar to temple run?

Hello.
I’m creating an endless runner game, and I need to control the player to left and right by tilting the device, exactly as it happens in the game Temple Run.

I’m using this code:

movex=0;
iPx = Input.acceleration.y;
if (Mathf.Abs(iPx) > moveThreshold)
{
    movex = Mathf.Sign(iPx) * Time.deltaTime * speed;
   transform.Translate(-movex,0,0);
}

The problem is that the movements are not smooth as temple run, and the device must be tilted a lot to make effect.

I already googled a lot, but coudnt do it by myself.

thanks.

Hi,use given below code for tilting a gameObject like Temple Run character.

using UnityEngine;
using System.Collections;

public class AccelerometerInput : MonoBehaviour
{
void Update ()
{
transform.Translate(Input.acceleration.xTime. smoothDeltaTime10, 0, 0);
}
}

Thanks
Ram

var dir:Vector3 = Vector3.zero;
var moveSpeed:float = 10.0f;

function Update() {
    dir.x = -Input.acceleration.y * moveSpeed;
    transform.Translate(dir.x,0,0);
}