Questions tagged [accelerometer]

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.

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

Integrating accelerometer data samples to get velocity and displacement

I am working on an android app built in Unity that would allow the users to track their movements by just using the data coming from the device sensors. I have read about similar issues already and I ...
0
votes
1answer
162 views

Tilting a game object left/right/forward/back with gyroscope, regardless of player's heading

I'm working on a mobile game in Unity and using the gyroscope to rotate an object along the x and y axes. ...
0
votes
1answer
58 views

Why the value of float xAxis = -Gdx.input.getAccelerometerY(); is given a accelerometer of y axis?

I am learning game development from the udacity course "https://classroom.udacity.com/courses/ud405/lessons/5389263706/concepts/53853441090923" I am stuck with one statement in the code about ...
1
vote
1answer
131 views

Accelerometer input for flying game

I'm trying to create an infinite flying game where the gameobject (a plane) keeps moving forward and at a particular height throughout the game. I want to be able to roll and pitch the plane but not ...
0
votes
1answer
115 views

how to avoid Z- axis gravity from affecting my mobile game?

I am making a mobile car game, and as it is a serious game for upper limb rehabilitation. The mobile is attached to the forearm of the patient, hence the forearm movement will move and rotate the car. ...
0
votes
1answer
37 views

Transformation movement by using Accelerometer data

Is It possible to make transformation movement by using Accelerometer data or Accel + Gyro ? as we know, we can make rotation by using Accel or Gyro data. However, how can we make transformation ...
3
votes
1answer
559 views

Moving sprite using the accelerometer in LibGDX?

I don't know how to use accelerometer in LibGDX; how could I use the the motion sensor? I'm working for a top down game with the motion sensor. I'm new to this framework. My sprite image is already ...
1
vote
1answer
504 views

How to use Libgdx Accelerometer?

I am developing a game with libgdx for android.I want use accelerometer for motion control.I am controlling a coin within screen bounds. I want to apply gravity according to device orientation as you ...
0
votes
1answer
689 views

How would I process accelerometer data to use it for camera rotation?

I'm using Three.js to make a web-based 3D first-person game. I would like the player to be able to control the camera rotation with their device's accelerometer. The sensor data is received via the <...
2
votes
1answer
623 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: ...
1
vote
1answer
904 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 ...
1
vote
1answer
4k 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
654 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
143 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
889 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: ...
1
vote
2answers
1k views

Moving sprites using the accelerometer (Android)

In my previous game, I was moving my sprite like so: ...
6
votes
1answer
559 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: <...
3
votes
1answer
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: ...