• Godot Help
  • Is there gyroscope / accelerometer support when exporting for the web?

I am building a 3D, first-person, simple game in Godot 4 with focus on web browser support and looking now in adding gyroscope support to be able to rotate the camera (look around).
As a start I tried exporting this demo to the web: https://github.com/godotengine/godot-demo-projects/tree/master/mobile/sensors
Nothing worked.
I then search for information about how to request permissions to the web browser for using those sensors on mobile devices. I could not find anything at all.
Does anyone know if this is currently possible in Godot 4 and, in case it is not possible, are there any plans of adding support?

  • The Documetation say's

    This method only works on iOS, Android, and UWP. On other platforms, it always returns Vector3.ZERO.

    so no HTML5 support.

    But you can easily add this via Javascript. Don't know how responsive this is.

The Documetation say's

This method only works on iOS, Android, and UWP. On other platforms, it always returns Vector3.ZERO.

so no HTML5 support.

But you can easily add this via Javascript. Don't know how responsive this is.

Thanks for clarifying this! I will look into the Javascript implementation and how to integrate it with Godot.