Possible to access Accelerometer?

Possible to access Accelerometer?
0.0 0


I know it is possible to do so with C++, but is it possible to access the accelerometer (for android devices) directly with javascript? Thanks!


Hi, I hope it will help.

MainScene.prototype.onDidLoadFromCCB = function()
   this.rootNode.onAccelerometer = function(event) {

MainScene.prototype.onAccelerometer = function(accelEvent) {


Hi, I’m new to this.

Where and How do it add this Code ? Do i have to open a new JS file named “Accelerometer.js” (for instance)? How do it link it with my Actor in the code?
Does this work on Android & iOS alike?

Thanks !