I need to make this script so that when my character falls on his side, movement is normal. This is my script but when you fall on your side and tot the device, you move up and down. It's a 2D game if that maters.
using UnityEngine;
using System.Collections;
public class AccelerometerInput : MonoBehaviour
{
void Update ()
{
transform.Translate(Input.acceleration.x, 0, 0);
}
}
↧