Search Unity

Need best collision detection in 30 fps

Discussion in 'Physics' started by segant, Aug 16, 2019.

  1. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    102
    Hi i am developing an android game. I have mesh collider on ground and fixed timestep like 0.03333333.
    I'm using physics material for many collider. My problem is that sometimes ground collision detection can't detect high velocity objects. I'm using Continuous Dynamic for these objects and for rigidbody extrapolate.
    I have tried multi box it has the problem and i need long range collision so box dimension needs to extend at least 600. This wasn't good some objects could get through planes. But collision detection was better in small objects. In broadphase detection isn't good as multibox but object's mostly doesn't penetrate.
    So i need information about which preferences are good for physics ,rigidbody and collider in 30 fps.
    I need collision detection by frame not depend on velocity. So speculative is not good for me.
     
  2. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    507
    I thought that Continuous Dynamic was, in theory, supposed to never fail right? It should be the same as the raycast solution which checks forward every FixedUpdate to make sure it will not pass through anything. I'm not sure how extrapolation will impact the collisions but you may wanna try interpolation instead so it doesn't move the object beyond what it's calculated position should be, at least I think that's how it works. Your mesh collider on the ground could be very thin so it may help to inflate it or use a convex collision if possible, or just replace collision entirely with custom shapes.

    I still have that old raycast code if you want, though I'm pretty sure I stopped using specifically because Continuous Dynamic did the same thing.
     
  3. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    102
    Thanks i may replace it with box collider but i will try to change extrapolate to interpolate and when i get best result i will use it and give a try to multibox again.
     
    SomeGuy22 likes this.