In more detail what i want to do is detect the speed of the player so i can figure out what animation to play and what way the player should be facing for PC i have the current code
transform.Translate (Input.acceleration.x, 0, 0);// mobile input THIS IS THE MOBILE PART But should use Rigiedbody2D
float move = Input.GetAxis ("Horizontal");// allows user to change control THIS WILL NOT WORK FIND SOMETHING ELSE PC ONLY
GetComponent<Rigidbody2D> ().velocity = new Vector2 (move * Max_player_speed, GetComponent<Rigidbody2D> ().velocity.y);// basic movement
if (move > 0.0f) {// add running right animation here this may not work
print ("running right");
}
if (move < 0.0f) {// add running left animation here
print ("running left");
}
so what i need to do is make it so that instead of getting information from Horizontal input but get it from the acceleration input for mobile devices and use the same system.