- Home /
Tilting game for android
Hello everyone
I was making a game like doodle jump in unity but i really don't know how to make a script so if i tilt my android phone my players xposition = +1
I'm not a real beginner in unity but i haven't made any games for android before Here's my script:
pragma strict
function Acceleration () {
var period :float = 0.0; var acc : Vector3 = Vector3.zero; for (var accEvent : AccelerationEvent in Input.accelerationEvents){ acc += accEvent.acceleration accEvent.deltaTime; period += accEvent.deltaTime; } if(period > 0) acc =1.0/period; return acc; }
If you guys would help I really appreciate it
greetings paul
Your answer
![](https://koobas.hobune.stream/wayback/20220613140055im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Hinge joint around two axis 2 Answers
Accelometer controls for iOS and android 2 Answers
Bike wobbles like pendulum after applying gravity 1 Answer
Android Tilt controls help 1 Answer