Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 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
0
Question by schwertfisch · May 15, 2011 at 08:43 AM · iosdisableaccelerometer

Is there a way to disable the rotating black border when rotating the iphone?

Since my iOS game is played only in portrait mode, I don't see any reason for the accelerometer to work (and consume energy). Plus, whenever I rotate the device, I see this black border that rotates to the new orientation, which is a bit annoying.

So, is there a way to disable the accelerometer?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Ashkan_gc · May 15, 2011 at 09:04 AM

there is no way to disable accelerametor using unity's api and i don't know about the apple objective c one. but i think it's the hardware that always works and cosume power if you want it or not. don't check and use it in your code.

about black borders i should say that they are possible to be disabled in code. you should just disable keyboard rotation. use iphoneKeyboard.autorotateX properties. there are different ones for different directions.

Comment
Add comment · Show 2 · 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 schwertfisch · May 15, 2011 at 09:30 AM 0
Share

Thanks Ashkan ;-)

avatar image Ashkan_gc · May 16, 2011 at 03:58 PM 0
Share

oh nothing special man!

avatar image
3

Answer by Eric5h5 · May 15, 2011 at 02:28 PM

Change the "#define kAccelerometerFrequency" line in the AppController.mm file from 60 to 0. http://unity3d.com/support/documentation/Manual/iphone-Optimizing-MainLoop.html

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 schwertfisch · May 30, 2011 at 08:12 PM 0
Share

Thanks Eric, I thought that what I wanted was disabling the accelerometer, but actually it was the iphone$$anonymous$$eyboard property that I was looking for. I found your answer very useful though :)

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

No one has followed this question yet.

Related Questions

Player Movement in Apple TV 0 Answers

Accelerometer - accounting for gravity for arbitrary device angle 1 Answer

Loading disabled GameObject assets 0 Answers

adjust netural position accleromter 0 Answers

How to rotate your device and counter rotate camera 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