Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question PhysicsCollider welding not providing optimal results with Havok

Discussion in 'Physics for ECS' started by Lowscope, Feb 16, 2021.

  1. Lowscope


    Jun 4, 2015
    Recently I've made the switch to Havok, this was mainly to solve the "Speculative Contacts" issue for a mini golf game I'm working on. Moving the ball over the ground works fine and there are no cases of it hopping anymore.
    However it seems like it still likes to behave oddly when hitting edges of intersecting meshes.
    Sometimes it jumps out of the stage, or bounces along the edge.

    You can watch this to further understand what is happening:

    Sometimes it also jumps upwards, when hitting the seams. Is there a way I could go about
    mitigating this issue? Currently my colliders are set up as "Lego" bricks, as in, there are no openings in them.
    I've also tested this with meshes that have the front sides removed, but it gave the same results.

    Anyone here with advice as to how I could solve this issue?
  2. milos85miki


    Nov 29, 2019
    Hi @Lowscope , not 100% sure where the underlying problem is, but here are some hints on what you could try:
    1. Adding Physics Debug Display component and ticking Draw Contacts will help you see the contact normals and figure out which ones are causing undesired behavior.
    2. Scheduling an IContactsJob similar to Assets\Demos\5. Modify\Scripts\ModifyNarrowphaseContactsBehaviour.cs in UnityPhysicsSamples could help iron out the strange normals.
    3. You might sometimes hit the "back" side of a mesh triangle and that could cause tunneling with the above script. You could iron that out when creating the mesh or try to detect it in the IContactsJob and flip the normal.

    Hoping these will help. A minimal project with repro would certainly be useful if you don't manage to fix it.