- Home /
Using accelerometer-tilt to control a flying orb
Hello, Been long since I used Unity, nice to be back C:
Anyways, I am trying to control an orb which is already set to fly towards some target. I want to control it using the accelerometer, assuming the device is held parallel to ground and the home button is on the right side.
I would want that when player tilt the phone up the orb should go up and when tilted down it should go down same with the other axis, when tilted left shall go left and tilted right the orb shall go right.
I would like a small help on how to implement this and also how to configure the axes. Thanks :D
Answer by Caiuse · Dec 03, 2012 at 09:54 AM
this answer should get you started.
by the way, always have a little search through Unity Answers before posting a question. Most questions have already been asked and answered.
$$anonymous$$ore info for future readers :
Accelerometer example : https://www.assetstore.unity3d.com/en/#!/content/8566
Accelerometer tutorial : http://unity3d.com/learn/tutorials/modules/beginner/platform-specific/accelerometer-input
Accelerometer Scripting Reference : http://docs.unity3d.com/ScriptReference/Input-acceleration.html
Answer by dilmer · Sep 12, 2013 at 06:59 AM
Check out this control I wrote which may help you out.
Guys,
I worked in a game recently which needed an accelerometer control for a spaceship I created which is now available in the App Store as well, during my programming I found myself using this control for other games. I would recommended as is super easy to integrate into your game.
At least attempt to answer the question if you're going to advertise like that.
25$? Yeesh.
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
Face Direction of Tilting 1 Answer
Tilt control for jump 0 Answers
Android Tilt controls help 1 Answer