I'm a new Unity/Android user/developer. I've gotten a ball rolling in android using the tilt functionality, but that script doesn't work for a simple box. How would I make a box move by tilting the android device?
Thanks
I'm a new Unity/Android user/developer. I've gotten a ball rolling in android using the tilt functionality, but that script doesn't work for a simple box. How would I make a box move by tilting the android device?
Thanks
I've figured it out. These lines of code should do the trick for moving an object in a 2d space
function Update () {
var dir : Vector3 = Vector3.zero;
dir.x = -Input.acceleration.y*.5;
transform.position.x += dir.x;
}