- Home /
Question by
landoncr4d · Sep 06, 2015 at 12:38 PM ·
gravityballaccelerometer
I am having trouble with my accelerometer for my iphone app
hello, I am a huge beginner for unity and I am making a mobile game that involves tilt. I have created a basic accelerometer but the one i made does not work because it clips through objects and as I want my tilt controls to only go on the x and y axis, mine also goes up and down and does not follow the games gravity, my game involves falling on a 3d plane and I want my controls to be similar to that of labrynth iphone game. If someone could help me out or point me somewhere that would help that would be great and I am extremely grateful. this is my current accelerometer. using UnityEngine; using System.Collections;
public class AccelerometeInput : MonoBehaviour {
// Update is called once per frame
void Update () {
transform.Translate(Input.acceleration.x, 0, -Input.acceleration.x);
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612002754im_/https://answers.unity.com/themes/thub/images/avi.jpg)