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 NinSonNar13 · Jun 19, 2014 at 12:49 AM · physicscollidersfriction

Friction Issue with Multiple Colliders Touching

EDIT:

Sorry about the image links being broken now; they were removed from where I was hosting them.


I've encountered an issue with multiple colliders touching, primarily evident when I am making a wall out of stacked boxes. When jumping against this wall, strange things will happen depending on the number of colliders that the jumping figure is in contact with at the start of the jump.

The following images illustrate my test. I have a figure (green) that can move side-to-side and jump, and has no physics material. The red boxes do not have rigidbodies, only box colliders. The text on the floating red box shows how many boxes occupy the same space (later images are tests when several boxes are duplicated in the same space). The text in the upper left shows the recorded top height of each jump.

alt text

First test: Image Missing

Second test: Image Missing

Another plain jump, but introducing the blue box collider I've used for this figure so it could jump against walls. This box collider has a frictionless physics material attached (all values on it have been set to 0, and the friction mode is minimum).

As you can see, the maximum height is the same.

Third test: Image Missing

Jumping while touching the single cube with friction. As expected when two colliders with friction run against each other, the jump isn't as high. The height value for this test, and other tests while there is friction, vary slightly.

Fourth test: Image Missing

The results of this test actually surprised me. This already presents an issue with friction in the physics system. The jump is actually higher than a plain jump! The height values for this test, and other frictionless tests, are consistent when repeated.

Fifth test: Image Missing

While I noted in test 3 that the value varies slightly each time it is repeated, it is consistently higher than any height produced in Test 3.

Sixth test: Image Missing

This is where things start getting really interesting. This is similar to the scenario I presented at the beginning, where a wall is made by stacking boxes. The jump height is noticeably higher than a plain jump.

Seventh test: Image Missing

And this is where all logic seems to go out the window (to me at least). If I duplicate the floating box 4 times, so the figure is in contact with 6 boxes simultaneously when it jumps, it goes much higher, and that is with friction! True, it goes up a bit slower and comes down slower, due to the increased friction, but it still isn't reasonable it actually goes that high.

Eight test: Image Missing

As you might have guessed from the pattern in the previous tests, having the frictionless component in contact with the 6 boxes allows an even higher jump. Not shown, I extended the boxes massively to see how high it would go. It went over 9 units high. Also noticeable, even though it is supposedly using a frictionless material, the rise and fall was slower than when it was not in contact with anything (if, at the top of that 9 unit jump, I moved the figure so it no longer contacted the boxes, it fell faster).

I hope I have sufficiently presented the issue. If anyone understands the issue, and better yet, if you know how to solve it, please let me know. Or if you think this should be submitted to a bug report or other location, just tell me where to go!

plainjump.png (21.9 kB)
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

1 Reply

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

Answer by NinSonNar13 · Jun 28, 2014 at 02:32 PM

Looking around for similar problems, I found a form of a solution. There are differences in the way the physics engine handles collisions when colliders do or do not have a rigidbody component attached. It seems there are some issues with using static colliders (those without a rigidbody) in cases like this, so adding a rigidbody to the boxes, with it being set to kinematic to prevent movement, seems to solve it.

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 shochet · Jan 27, 2015 at 07:26 AM 0
Share

I had the same problem working on a 2.5D platform game (user is editing the levels, not the developer). I could not find any other solution. Thanks for the suggestion. While I suspect adding all those rigid bodies are expensive, it did solve my problem.

avatar image Pawl · Feb 27, 2015 at 06:08 AM 0
Share

Well presented. I ran into this exact issue when building a 3d platformer. If the character (frictionless) jumps while in a corner touching more than one collider (also frictionless), it feels like friction is getting applied heavily and both the rise and fall are slowed (I've also seen the case where the jump height is actually increased like you described). This happens even without applying an input force to the player, ie absolutely zero XZ movement.

Adding a kinematic rigidbody did fix the problem for me as well, but I wish there was a better solution.

I do notice the problem comes back after I disable/re-enable one of the wall gameobjects at runtime though, so be careful.

Also, your links are broken.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Pallet falls through forks 2 Answers

Angular Friction 0 Answers

Collision detection for many colliders 0 Answers

Calculating Sphere vs. Plane Friction 1 Answer

Collision Precision 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