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
1
Question by IADev · Feb 12, 2013 at 02:03 PM · androidmovementphysicstiltmarble

physics.gravity with tilt game

Am making a tilt game by applying gravity on a marble which makes it move on the plan in this case the maze.

The ball have a rigidbody with mass set to 1 .The plane model have 2 parts the plane and the walls .

the plane have a metal material and smooth sphere colider unchecked .The walls have a custom material with dynamic and static friction set to 0 and both friction and bounce combine set to minimum .

the problem now is that if the marble is at a corner where it colid with 2 edges of the wall or if i manage to keep the device leveled long enough for the marble to be still it will get stuck .

Turning off and on the smooth sphere colider on the wall will unstuck the marble any idea what might be causing this ?

the code am using for moving the marble is

 // Move object in XZ using accelerometer (home button at right hand)
 var speed: float = 2.0f;
 function Start(){
 }
 
 
 function Update(){
 var xmovment: float = -Input.acceleration.y;
 var zmovment :float = -Input.acceleration.x;
 
 Physics.gravity= Vector3(zmovment*5,-15,xmovment*5);
  

}

Comment
Add comment · Show 2
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 Dave-Carlile · Feb 12, 2013 at 02:04 PM 0
Share

If you can't be bothered to use proper capitalization and punctuation, I can't be bothered to read your question and provide help.

avatar image IADev · Feb 12, 2013 at 02:10 PM 1
Share

sorry for that editied

1 Reply

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

Answer by aldonaletto · Feb 12, 2013 at 02:42 PM

I suspect that the rigidbody went to bed: when a rigidbody stands still for a while, it goes to the sleep mode. Try this solution:

 function Update(){
   if (rigidbody.IsSleeping()){
      print("Wake up little Suzy!");
      rigidbody.WakeUp();
   }
   ...
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 IADev · Feb 12, 2013 at 02:54 PM 0
Share

how did i miss this thank you very much you saved my life been trying to fix this for like a week or so

avatar image smallbit · Oct 26, 2013 at 03:05 PM 0
Share

$$anonymous$$an I have been trying to resolve that problem for 3 days now, Aldonaletto you are the boss !!!

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

12 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

Related Questions

tilt control for jump 0 Answers

Android game character continuous movement when touching screen ends,android game character continuous movement when touching screen ends 0 Answers

Physics on a Ball 1 Answer

swipe movement script like in subway surfer 0 Answers

Hi .... i made a pc game controls work fine....how do i use accelerometer for android...for ex if i wanna move right i tilt right...etc 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