- Home /
animation play with phone movement
When i tilt towards right i want an animation to play and wen towards the right another animation to be played???? When the phone isn't tilted or shaken then neither of the animatin is to be played... please do help me out here
i used the -input acceleration
var dir : Vector3 = Vector3.zero; dir.x=-Input.acceleration.x;
if(dir.x<0.0) {
animation.Play(); }
after i loaded it unto the phone n started it even before i could tilt it the animation began to play...the problem seem wen i raise the phone and the phone is at some angles not parallel to the floor. but wen parallel it works fine not exactly....like i want the animation to play wen the phone is tilted and not play wen the phone isn't tilted..........can u please me ??
Your answer
![](https://koobas.hobune.stream/wayback/20220613120802im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
turn on off particle system 1 Answer
Unity Texture import Setting For Android Game 0 Answers
A node in a childnode? 1 Answer
Texture2d.Readpixel slow down performance while stand-alone exe is minimize 0 Answers
How to change a string into integer 2 Answers