An accelerometer is a sensor, usually embedded in smartphones, that detects the orientation of the device. Accelerometers are commonly used in racing and flying games as a primary input source.

learn more… | top users | synonyms

0
votes
1answer
27 views

Get device rotation in Y axis

So using LibGDX accelerometer methods, I'm able to get the rotation of the device in the X and Z axes in degrees with this code: @Override public void render(float delta) { float accX = Gdx....
1
vote
1answer
42 views

LibGDX: How to make something like vector rotation sensor with accelerometer and compass values?

So I've tried the vector rotation sensor using the Android API and it works perfectly to do what I want, but LibGDX does not support this sensor. I've been searching and it seems like I can do the ...
0
votes
0answers
11 views

how to determine the speed of the object using the accelerometer, if only known heavy ball

I'm making a ball maze using the accelerometer. There are four balls and each ball has a different weight. how to make a ball weight affect the speed of the ball.
1
vote
1answer
347 views

Calculate the displacement of device in unity

I'm making a 3D game in unity where the object should move forward and backward as the android device moves/accelerates in the Z axes. ie. When the player moves the devise in the direction of the +ve ...
0
votes
1answer
93 views

Unity3D - How to get highest value for acceleration from Input.gyro

I'm trying to develop an app that can detect car acceleration, braking and cornering speed. I need to detect device acceleration. Is that acceleration high or low?. Like flo app on Google Play. I'm ...
0
votes
2answers
71 views

Handling accelerate in different devices

I am adding tilt controls to my game. The sensor values I get are different in different android devices which results in random behavior. Anyone knows how can I tackle this situation? I tried ...
2
votes
1answer
222 views

Use Accelerometer for Roll-a-ball Movement

I'm working on maze game for Android in Unity 5.1.1f1 and I have troubles with controlling my ball with accelerometer. At start I tried: public class PlayerController : MonoBehaviour { public ...
1
vote
2answers
288 views

Moving sprites using the accelerometer (Android)

In my previous game, I was moving my sprite like so: float time = 10f; //Number of seconds to pass a pre-defined area (using the screen width in this example) float velocity = 1f/time; //work out ...
5
votes
1answer
190 views

How do I implement tilt controls that work even when the device is not vertical?

I'm using libGDX to develop an Android game. The main character can be moved freely in the 2d plane by tilting the phone. The relevant part of my current implementation looks somewhat like this: ...
2
votes
0answers
2k views

In Unity on Android, how can I rotate an object with the accelerometer?

I'm making a game where you control a platform with balls falling on it, and you have to balance the balls and prevent them from falling off. I'm currently using a mouse to control it with this code: ...