Question by
mikeelovee1 · Apr 20, 2018 at 08:44 AM ·
c#accelerometer
Can anyone please help me with this accelerometer for a platform jumping game where the player goes left and right?. It seems to work just not very smoothly. Thanks
public class PlayerMove : MonoBehaviour { /*public float speed = 25f; Rigidbody2D rb;
private void Start()
{
rb = GetComponent<Rigidbody2D>();
}
void Update()
{
float temp = Input.acceleration.x;
transform.Translate(temp * speed * Time.deltaTime, 0, 0 );
} */
Comment
Your answer
Follow this Question
Related Questions
Is it possible to access the native step-counter on mobile platforms. 2 Answers
How to pause accelerometer movement 1 Answer
How can I change controls to a accelerometer for mobile 1 Answer
How do i limit my accelerometer movement 1 Answer
Assigning input.acceleration to float then adding to a Vector3 to AddForce C# 1 Answer