Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
6
Question by SingularDeviation · Mar 16, 2015 at 09:42 AM · androidcompassgyro

Does Input.gyro.attitude (always) use compass?

As far as I could find, and what a comparison test seems to confirm, "Input.gyro.attitude" simply passes the raw Android TYPE_ROTATION_VECTOR SensorEvent value when using Android. This SensorEvent value, which is classified as using a 'virtual sensor', is supposed to use a combination of the accelerator, gyrometer and magnetometer, depending on what is available on the device.

Does Unity's Input.gyro.attitude also use the magnetometer if Input.compass does not get enabled in the code? Because the gyroscope and the compass obviously need to be enabled seperately, but the 'fused' data gets returned through the gyroscope object only. Does Unity automatically enable the compass when retrieving the attitude data?

EDIT: I just realized that in raw Android code the sensors don't have to be enabled in the same way as Unity handles enabling. So if TYPE_ROTATION_VECTOR is actually used, as I suspect, then there is probably no way to disable the magnetometer, which would mean the magnetometer is always used in Input.gyro.attitude?

Comment
Add comment · Show 2
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 munkbusiness · Aug 22, 2017 at 03:38 PM 0
Share

I know this post is 2+ years old, but I would very much like to know this also, it is kinda hard to get this information from the documentation.

avatar image SingularDeviation · Aug 25, 2017 at 04:45 PM 0
Share

Unfortunately I have not found or received an actual answer to this question. However, during further experimentations my observations still seemed to hold (that the magnetometer is always used in Input.gyro.attitude when available on the device). For my purposes it was safe to assume so based on my observations, but this may of yours not apply to you.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by anaeronbaggins · May 07, 2018 at 08:15 AM

I do believe that input.gyro.attitude uses a compass or a magnetometer. Since my android phone does not have a compass or a magnetometer, I am unable to get the output for Input.gyro.attitude.

Comment
Add comment · Show 1 · 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 munkbusiness · May 07, 2018 at 08:29 AM 0
Share

You sure that is the reason? First of have you built it and not just run in unity remote? I also assume you had gyro enabled?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to setup android build so that users without gyroscope do not see it in Play Store ? 1 Answer

I would like to know if with a unity free is possible to use gyroscope android? 1 Answer

Problem with Gyro in Unity Android project 1 Answer

Is there no simple way to get a device heading in Android with Unity? 2 Answers

Read Phone Info From Editor? 0 Answers


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