Help! move a specific entity with deviceorientation?

I’m looking for a script that allows an entity to move around the 3 axes getting the information from deviceorientation. The link shows a project similar to what I need, but there is a script that turns the whole scene :frowning: …and I need to turn it on one entity, without affecting the others. PlayCanvas 3D HTML5 Game Engine. I need something like this
6 DOF IMU (3 axis accelerometer, 3 axis gyroscope), Arduino, OpenGL, Python, complementary filter - YouTube.

Here is a project with the barebones of rotating an entity with the device orientation: https://playcanvas.com/project/525009/overview/device-orientation

Edit: Side note: The project you linked doesn’t actually rotate anything, it just changes the direction of gravity in the world.

Thank you for reply… But not work in muy device :confused: i have a android 4.4.2 …in first link, the gyroscopy works very good. But now i fork your project (without changes) and not work… The cube no move. I have a device android 4.4.2

The code in the project you linked isn’t supported on Safari on iOS, unfortunately.

I don’t have a device with 4.4.2 to test with unfortunately.

What version of Chrome are you running?

I use chrome 63 … :neutral_face:

Hmmm… Device Orientation should be supported: https://caniuse.com/#search=deviceorientation

Is the cube rotating at all in my project? Or is it completely stock still?

Inmobile complete :sweat:

Looks like you have to check the device/browser supports one or the other and cater for each.

Now i try with android 6 and lastest google… Not work for me. :frowning:

Strange, works on my S7, Android 7.0, Chrome 63.

Does your phone(s) have an accelerometer?

1 Like