make player face in direction of active force

I have a character which moves based on the android tilt sensor.

rigidbody.AddForce (Input.acceleration.x,0,Input.acceleration.y);

I am experimenting with the idea of making the character “drift” around the level, perhaps firing a projectile in its forward direction. I either need to manipulate the acceleration values or read the active forces to create a vector3 relative to the player, then set the player’s forward direction to it.

In simple terms, if I tilt the device forwards, the character will face and slide in that direction. If I then tilt it right, the player should face in that direction immediately while the momentum continues to carry it up the screen.

Try this:

var v3 = Vector3(Input.acceleration.x,0,Input.acceleration.y);
rigidbody.AddForce (v3);
transform.rotation = Quaternion.LookRotation(v3);