Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

ECS Physics Bodies Getting Caught on Geometry Intersections and Subdivisions

Discussion in 'Physics Previews' started by JohnnyTurbo, Mar 19, 2020.

  1. JohnnyTurbo

    JohnnyTurbo

    Joined:
    May 17, 2017
    Posts:
    42
    Hey Everyone,

    I've been playing around with the new ECS and the new Unity.Physics and have ran into a bit of an annoying issue. When making a physics body move in a straight line across some section of geometry, the physics body gets caught up on the intersections between pieces of geometry and causes the physics body to jump.

    I've also noticed that this happens on the subdivisions of single pieces of geometry e.g. a single Unity plane or a single Pro-builder plane with subdivisions.

    Below is a video demonstrating the behavior. You can see that the ball jumps when crossing from one mesh to another.

    Any idea why this may be happening or if there are some settings I can tweak so this doesn't happen?

    Let me know if you need any more information, thanks!

     
  2. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    Can you show up the colliders visually?
    If It is a plan, are you using a box collider?
    Are this jupe occurs where box colliders intersect?
     
  3. JohnnyTurbo

    JohnnyTurbo

    Joined:
    May 17, 2017
    Posts:
    42
    One thing I've notice since I posted that is that I do not see the same bounce on mesh subdivisions when using the Physics Shape component - rather than using a standard collider for authoring.

    However I am still seeing this happen where the colliders intersect - I've tried using mesh, box, and plane colliders, all with the same result as displayed in the video
     
  4. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    Does the ball rotation has any rotation drag restriction?
    If you make an inclined road and you take out your rolling ball script (to maintain it rolling),
    Do you have the same problem? could it be the torque force somehow?
     
  5. JohnnyTurbo

    JohnnyTurbo

    Joined:
    May 17, 2017
    Posts:
    42
    I've played around with the linear and angular dampening properties and it does not seem to have any effect.
    Yes, same behavior happens if the road is inclined. In the video I recorded, I just set the initial linear velocity, so there is no force constantly being applied. However this still happens when I constantly apply a force to the ball.
     
  6. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    The ball is a sphere collider, correct?
    And if you convert the ground mesh into a mesh collider?
    Changing the mass of the RB sphere?
    Tray to take out the physics material type?
    Or tray to replace the sphere with the default one?

    I test it and I'm not having that problem
    upload_2020-3-21_2-0-5.png


    Inside Rigidbody, you can also increase the interpolation and collision detection to other options
     
  7. JohnnyTurbo

    JohnnyTurbo

    Joined:
    May 17, 2017
    Posts:
    42
    I've been trying with the sphere collider/rigidbody and Physics Shape/Physics Body components - either configuration gives me the same outcome. Changing collider type and Rigidbody mass doesn't change anything.

    Here is a basic scene I've created with entities as close to default as possible and am getting the same results:
    https://drive.google.com/open?id=1ZGRANmMMYT_bEZkGvaMqRSNTvYYRZmgm

    Using Unity version 2019.3.6f1
    Packages in use:
     
  8. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    This is a general issue with the approach used for handling continuous collection detection that creates speculative contact points. There are details here and here. If not using the solution with Havok Physics check out the ModifyNarrowphaseContacts demo in the samples project.
     
    JohnnyTurbo likes this.
  9. JohnnyTurbo

    JohnnyTurbo

    Joined:
    May 17, 2017
    Posts:
    42
    Thank you so much, this was exactly the documentation I was looking for.