• 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
Question by ina · Feb 13, 2012 at 05:35 AM · androidiosmobileaccelerometer

Using the accelerometer to move a player as the real user walks

Is there a way to use the accelerometer to move a player, as the user who is holding the device ('real user') walks around the room?

Comment
Flickayy
Emperor

People who like this

2 Show 9
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 Alphamox · Oct 07, 2014 at 04:03 PM 0
Share

Hello,

i know its been a while since your question, but im facing the same issues. did you have any developments/updates on how to solve, break this problem?

(sorry for posting it on the wrong place)

avatar image tanoshimi · Oct 07, 2014 at 04:29 PM 0
Share

Sure. Input.acceleration. http://docs.unity3d.com/ScriptReference/Input-acceleration.html

avatar image Alphamox · Oct 07, 2014 at 05:57 PM 0
Share

@tanoshimi thanks for your reply. i'm new at this issues so im facing problems trying to figure out how to do it. i've seen all the unity documentation but it confuses me for not knowing what and how to use it. i've tried the input.acceleration before but the results were far from what i expected. could you somehow tip/explain to me how to achieve the player movement with real user walking input?

avatar image Alphamox · Oct 07, 2014 at 06:10 PM 0
Share

@ado112 but dont you think it can be achievable, if not directly, through the combination of some features?

avatar image ByteSheep · Oct 07, 2014 at 07:05 PM 0
Share

The lack of games and apps implementing this makes it clear that it unfortunately isn't possible with current devices.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by ado112 · Oct 07, 2014 at 05:59 PM

I don't t$$anonymous$$nk that today's devices have sensors for that. T$$anonymous$$s may be possible if you connect device to internet then watch it's position from satelite(google maps or somet$$anonymous$$ng like that)but that is a very hard t$$anonymous$$ng to do.

Comment

People who like this

0 Show 0 · 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

Answer by ByteSheep · Oct 09, 2014 at 12:24 PM

I have looked into t$$anonymous$$s a w$$anonymous$$le ago and you are not the first to ask t$$anonymous$$s question. I was trying to do the same t$$anonymous$$ng (like many others) for a game I was developing.
The problem is that (at least on iOS) the accelerometer can't detect linear speed movements - see here. From what I've heard it's difficult to get more than a meter or so precision with iOS devices, but would be happy to hear otherwise.

See also: http://stackoverflow.com/questions/6647314/need-to-find-distance-using-gyroaccelerometer

Comment

People who like this

0 Show 3 · 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 Alphamox · Oct 09, 2014 at 02:10 PM 0
Share

Thank you for the answer. I'm trying to develop it for android (at least for now), and i had already checked that link and many others but with no conclusions or answers (for me). Now i'm thinking about another approach. I'm thinking about a pedometer implementation. I know it will only count steps, but it might give me just some basic data so i can turn it into character movement. Issues with direction and position will remain, but maybe it's a start for now.

avatar image ByteSheep · Oct 09, 2014 at 03:02 PM 0
Share

If you don't need it to be very precise (e.g. person moves 1 meter and the character moves a small distance - such as 1 meter in game) then you might be able to use the technique outlined in the stackoverflow post above.
However, I haven't personally tested this so it might be best for you to do further research and then do some tests of your own.
Let us know if you get any results ;)

avatar image Xpoint · Oct 08, 2017 at 07:19 PM 0
Share

Hey @Alphamox any result ? there should be results according your answer is in 2014 and now is 2017 :P

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

9 People are following this question.

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

Related Questions

Accelerometer - accounting for gravity for arbitrary device angle 1 Answer

iOS and Android Publishing 2 Answers

2D animations not playing in mobile 0 Answers

Creating an asset bundle at runtime 1 Answer

In what resolution should design my mobile game? 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