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 /
avatar image
0
Question by Databases · Oct 02, 2014 at 10:33 AM · accelerometerunity 4.5

Unity Accelerometer weird behavior!

Hello, everyone

(I'm using unity 4.5)

Unity accelerometer doesn't work properly, i'm trying to do the exact way provided here: http://unity3d.com/learn/tutorials/modules/beginner/platform-specific/accelerometer-input

I have set a cube like in the tutorial then i did assign the same code that is provided in tutorial to the cube, but the weird behavior is that the cube starts moving in the negative z-axis by itself without me touching the mobile, also the mobile is placed on a flat surface, in addition to that it moves insanely fast!

Note that i have tried it on two defferent devices, one is xperia z and the second is galaxy s4 but the result is the same.

any idea on what actually the problem is?

Thank you all for your time.

Comment
Add comment · Show 1
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 Databases · Oct 02, 2014 at 03:38 PM 0
Share

Please, any idea that could help is greatly appreciated.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tanoshimi · Oct 02, 2014 at 07:24 PM

Would "insanely fast" be at about 9.81 units per second, by any chance? (Put some Debug.logs in your code to print out the value of Input.acceleration.z). If so, it sounds like the accelerometer in your device is (correctly) reporting acceleration due to gravity. Some accelerometer readings are normalised to remove this, but in my experience it seems to vary from device to device.

Comment
Add comment · Show 9 · 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 Databases · Oct 09, 2014 at 06:44 PM 0
Share

it is between 0.998F and 1.001F

so any idea what should i do now? i mean the problem now is relative to the code or the device itself?

Thank you for your time.

avatar image Databases · Oct 11, 2014 at 11:55 AM 0
Share

i have noticed that when the mobile is not connected then the output is Zero

avatar image Databases · Oct 12, 2014 at 06:52 AM 0
Share

it seems like it is moving due to gravity on z axis but the problem is that it is working on unity z axis not the mobile z axis :\

avatar image tanoshimi · Oct 12, 2014 at 07:07 AM 0
Share

What do you mean by "not connected"? Unity Remote won't report accelerometer readings because your PC doesn't have an accelerometer in it - you'll have to properly deploy and test on the device. But it shouldn't make a difference whether the USB cable is physically plugged in or not. What is " Unity Z axis" - you mean global z rather than local z? Perhaps a diagram would help...

avatar image Databases · Oct 12, 2014 at 09:40 AM 0
Share

Yea i'm using Unity Remote, and i mean global z. Unity gives outputs when i use Unity remote.

Unity remote might be the problem, so i will try testing on the device itself.

Thank you.

Show more comments

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

26 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

Related Questions

Switch axis so phone is flat with accelerometer 1 Answer

Accelerometer input working in Unity Remote, not working in build. 0 Answers

Unity 4.5 [Pro] black screen after splash in iOS 0 Answers

Bag Toss Unity Accelerometer 1 Answer

accelometer problem 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