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 cmasterenko · Apr 26, 2011 at 02:53 AM · movementiphoneipadaccelerometer

Accelerometer Movement Problem

I'm working on a game that's kind of a spin off of tetris where you control the falling objects by tilting your device, but the problem I'm having is when someone tilts the device too much it starts getting stuck on the side instead of falling. Is there a way for me to override the movement when the user hits my side boundaries so the piece will continue to fall instead of get stuck on the side until the user tilts in the opposite direction?

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

Answer by Justin Warner · Apr 26, 2011 at 02:59 AM

Sense the piece is changing it's position every frame (I assume), then you could check the last XYZ (Whichever it is meaning it's not falling down), and check to see if it's in the same position, if it's in the same position, "manually" move it _ distance away, if it's moving enough, then leave it alone... Also, you can even have it so that it "snaps" to a "grid." Mind you, you'd have to code so said grid, but it's also a route you can take.

Hope this helps a little, good luck!

Comment
Add comment · 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
0

Answer by Yuemari · Apr 01, 2012 at 10:00 PM

I used to have a similar problem and the way i solve it was: In LateUpdate -save my position to a temp vector -move my object in the desired position -check if(position.(XYZ) < minlimit.(XYZ) || position.(XYZ) > maxLimit.(XYZ) ) -if this is true then im offlimits so i need to correct my position to the temp value stored previously -then object position = temp;

You need to have a minLimit and a maxLimit for this to work. Good Luck!

Comment
Add comment · 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

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

1 Person is following this question.

avatar image

Related Questions

Gyroscope based First person controller 0 Answers

Controlling Unity3D PC Application from IPAD/IPHONE 1 Answer

Move a Game Object (Camera) forward and sideways with the Mobile Sensor Outputs. How? 0 Answers

MIDI on iOS devices 3 Answers

What do i need to run my built application for iphone using unity to be run on android devices 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