• 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
2
Question by RunSwimFly · Mar 14, 2014 at 10:56 AM · collidermeshsmoothwheelseams

Discontinuity on mesh collider seams

I'm using a grid of meshes to represent a terrain. I've noticed some problems as convex and wheel colliders cross the border between two meshes.

A sphere rolling over the border will occasionally jump up even though in my test case the two meshes are completely flat. I've tried making the meshes overlap and I've tried bevelling them ever so slightly with overlap. I have smooth sphere collisions on. But nothing I do to the meshes can guarantee a smooth transition. As suggested in the answers changing the min penetration distance does help. Counter to what I expected bringing it to a near zero value reduces the jumping to imperceptible levels without introducing unwanted side effects.

However I haven't found a good solution for my problem with wheel colliders. The collider rolls over the border without any noticeable bump and provided it is not applying a longtitudinal or lateral force there is no problem. But if the tyre is cornering or accelerating it will suddenly slip and then grip as it travels over the border. This can affect the handling of the vehicle to a noticeable degree. Looking at in the debugger I can see that as the wheel crosses the border GetGroundHit will return a contact, the normal and position of the contact will be as expected and yet the force value will be zero. I suspect this tire load value of zero is probably also then zeroing the frictional forces for that frame. As with the sphere nothing I do to the mesh geometry seems to help. So save writing my own wheel collider code is there any way that I can write in the tyre load value I want used for the friction calculation? If I could do that I'd just use the value from the previous frame. Failing this I think I've reverse engineered the Unity tyre model to a sufficient degree in the past that I could perhaps apply my own direct force to the wheel for that one frame and get it close enough to reduce the problem.

None of this is particularly elegant. If anyone can suggest a way to fix the mesh transition itself I'd love to hear it.

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
2

Answer by le_duke · Mar 17, 2014 at 10:37 AM

I think that you need to play with the physsics engine parameters see : http://docs.unity3d.com/Documentation/Components/class-PhysicsManager.html

Increasing solver iteration count will increase physics precision.

You can also tweak the "min penetration for penality"

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 Raptosauru5 · Apr 06, 2020 at 10:01 PM 0
Share

This solution is not very recommended as it can break other parts of how physics will work.

avatar image
0

Answer by Raptosauru5 · Apr 06, 2020 at 10:04 PM

Rather than messing with physics, one solution that works well for me is to combine all terrain colliders into one big mesh collider. This works really good, but obviously it has it's own limitations, especially vertex count limit and therefore limiting the max size and also isn't probably very smart performancewise

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

22 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Having trouble getting a smooth collision with dynamic mesh collider 0 Answers

Wheel collider help 0 Answers

Strange behaviour with wheel collider 0 Answers

Edit WheelCollider's Axis, not the Mesh 0 Answers

Internal collisions 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges