Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by lightshape · Mar 17, 2015 at 09:05 PM · unity 5webglgyroscopesensor

Unity5 WebGL gyroscope access

Hello everybody,

I want to make a WebGL demo for Google Cardboard with Unity5.

Is there a way to access the gyroscope from a Unity5 WebGL Application running in Android or IOS browser? It works fine as Android Application, but I want to access it from a Android device via the web browser and without a Plugin.

Alternatively I consider to use an external javascript library and transfer the sensordata to Unity. In the web player I used Application.ExternalCall to call a javascript function and unity.SendMessage() to send a message from javascript to Unity. How can I send messages from a Unity WebGL Application to the embedding Website and vice versa?

Hints or sample code would be great!

many thanks, klap

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Wurghi · Apr 22, 2015 at 01:15 PM 1
Share

I'm currently having the same problem. $$anonymous$$y android can't run the index.html. Is WebGL-Export for mobile browsers planned to be implemented in the future?

avatar image brijensen101 · Feb 11, 2016 at 11:50 PM 0
Share

@schubkraft do you know if this will ever be supported? There are other webgl sites out here that currently support gyro via the mobile browser.

avatar image Schubkraft ♦♦ brijensen101 · Feb 12, 2016 at 08:20 AM 1
Share

I'm sure once we are extending our support to mobile browsers the gyro will be part of it. But there are no timelines attached to this, sorry.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Schubkraft · Apr 20, 2015 at 11:49 AM

Mobile browsers and devices are currently not supported by our WebGL export.

Afaik you can't get the gyroscope from WebGL atm.

For script interaction see the manual at http://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by patrik-org · Sep 26, 2021 at 08:45 PM

You can get through javascript interop as shown in sama-van's answer here:

https://forum.unity.com/threads/can-webgl-access-mobile-sensors.332566/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can Unity WebGL access mobile sensors? 1 Answer

Hi Guys , Anyone knows how to access cookies data like username & password of a webpage from unity while developing webgl game in unity 0 Answers

WEBGL SENDMESSAGE 0 Answers

I get an error in Unity WebGL. 0 Answers

WebGL crashes on Chromebook 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges