Type Number Event accelerometer Revision Current Public Release (2017.3184) Keywords accelerometer, zRaw
Provides the acceleration due to gravity relative to the z-axis of the device's screen in portrait orientation.
This is the raw value received from the device's sensor. No filtering or smoothing is applied to it.
This value is always relative to the device in portrait orientation, regardless of the current orientation of your application. So, if your application is running in landscape mode, you'll need to compensate by 90 degrees.
local function onAccelerate( event ) print( event.name, event.xRaw, event.yRaw, event.zRaw ) end Runtime:addEventListener( "accelerometer", onAccelerate )