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 JonD · May 31, 2012 at 11:52 PM · rigidbodyioscollisions

iOS Rididbody Collisions

I'm having issues with my rigidbodies falling through each other slightly.

Im creating a boggle clone, with a 5x6 grid of letters. Each letter has a rigid body that is non kinematic, interpolation is Interpolate, and Collision Detection is Continuous Dynmaic. When the user forms a word, the letters are deleted and new ones fall from above. I'm using triggers to determine the row / col position of the letters, this is why I'd like to use rigidbodies.

I'm using rigidbody.MovePosition() to handle movement. Everything worked fine until I tried moving this to the iPhone. On the computer, a Fixed Timestamp of 0.001 works fine, but it crawls on the phone. Updating the Fixed Timestamp between 0.04 - 0.067 greatly increases the speed, but the collisions are no longer accurate. I've sorted through tons of similar questions, but was unable to find a working solution.

Any advice on increasing collision accuracy and mainting a good fps would be greatly appreciated.

Thanks, Jon

Comment
Add comment · Show 3
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 whydoidoit · Jun 01, 2012 at 08:32 AM 0
Share

You could also try reducing the $$anonymous$$imum penetration penalty if you objects arent actually passing through the "ground" see here.

I'm not sure you really need physics for Boggle do you? Do you just want the rigid bodies for collision and handle the movement yourself? Set is$$anonymous$$inematic = true.

avatar image JonD · Jun 01, 2012 at 05:55 PM 0
Share

I've tried both solutions without any luck. I need my box colliders to be small, so maybe I need to do a check like a 2d collision system works with checking if a point is within a rectangle(3d cube)

avatar image JonD · Jun 07, 2012 at 07:17 PM 0
Share

I've updated my FixedUpdate method. The behavior is better, but I'm looking for the letters to stop falling at a consistent distance between letters.

void FixedUpdate() {

 var moved = FallSpeed * Time.deltaTime;

var offsetVector = new Vector3(0, myTransform.collider.bounds.size.y / 2, 0);

 var offsetPosition = myTransform.position - offsetVector;

 if (Physics.Raycast(offsetPosition, Vector3.down, out hit, moved))
 {
     if (hit.transform.tag == "Coin" 
         || hit.transform.tag == "Lift")
     {
         if (coinComponent.IsFalling)
             coinComponent.IsFalling = false;
     }
 }
 else
 {
     // Hit nothing, falling
     coinComponent.IsFalling = true;
     coinComponent.Triggered = false;

     myTransform.Translate(Vector3.down * FallSpeed * Time.deltaTime);
 }

}

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Character pushes a cart. How to prevent cart from clipping? 0 Answers

Mesh Collider colliding with Primitives is jittery 1 Answer

collisions not working 1 Answer

I'm trying to translate this code to work for touch devices 0 Answers

Why Rigidbody Collisions Bounce? 2 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