- Home /
Question by
ina · Dec 17, 2011 at 07:54 AM ·
physicsmobilegravityaccelerometer
Unity Gravity follows Gravity in "Real World" via Accelerometer
Is it possible to change the direction of gravity in the Unity coordinate system to always "point" in the direction of gravity, as determined from accelerometer?
Comment
Answer by headhunter45 · Nov 02, 2013 at 06:39 AM
Set gravity to 0 and add Input.gyro.gravity * Time.deltaTime to the rigid bodies in your scene.
You could also try Input.acceleration it includes gravity and any other forces on the device.
Your answer
Follow this Question
Related Questions
Move ball object based on gravity 0 Answers
Applying Normal force from ground to player 1 Answer
Mobile Controls Issue - Buttons working, but not 100% 1 Answer
Camera linked directly to device orientation 0 Answers
Gravity on a rotating platform 1 Answer