• 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
0
Question by Big Bang Studio · Jun 25, 2016 at 07:37 PM · mobileorientationgyroscopetilt

Get forward tilt out of a gyroscope

Hello guys,

I have been breaking my head over this issue for days now and for some reason i dont seem to get the logic behind the problem.

Situation: I am trying to use a gyroscope in a situation where i have a phone laying flat on its back on the table in landscape mode (button right). The values i want to use are the pitch and roll but the heading is irrelevant. I want to be able to trigger "forward, backward" from using pitch and "Left, Right" from using roll.

Question: "How do i get a single value out of a forward tilt of my phone for pitch or roll. i.e. how can i read if the phone is tilted 30 degrees forward / backward / left / right?"

alt text

I have been using a plugin and writing some of my own code which always seem to require two values. i.e. the Roll factor and Pitch factor for a simple forward tilt. Shouldnt it be super simple to just get a Pitch rotation in degrees?

Thank you so much in advance.

roll-yaw-pitch-lg-0.jpg (175.2 kB)
Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

49 People are following this question.

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

Related Questions

Is there a way to know the screen orientation when Screen.orientation == ScreenOrientation.AutoRotation? 2 Answers

How to test Screen Orientation? 2 Answers

unity horizontal and vertical axis based on gyro? 2 Answers

Shaking screen using the gyroscope attitude 1 Answer

Know when screen orientation has changed on mobile? better to keep one orientation? 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges