Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

We need a way to detect and resolve collision hits manually

Discussion in 'Physics' started by PhilSA, Jan 15, 2016.

  1. Bezzy

    Bezzy

    Joined:
    Apr 1, 2009
    Posts:
    75
    I'm encountering all the same issues in this thread, and agree with @EnokV that exposing all the contacts that a collider makes with a mesh is the way to go, rather than the current case of some aggregated/first found(?) vector that can't be readily picked apart. There's a definite loss of very handy data, which I'd love to see available to all.

    It's nice to simplify the api where possible, but in this case, the detail vs. the mesh is very absent.

    Passing back a list of triangle ids and a list of respective depenetration vectors would be pretty great. We'd have enough to fix it properly, hopefully once and for all! I feel like I've put at least a man-year into bodging around it, and never getting a solution which is robust or even satisfying.
     
    Psyker, kukuruzza2, EnokV and 2 others like this.
  2. Psyker

    Psyker

    Joined:
    Apr 1, 2013
    Posts:
    2
    This is still an issue after 5 years. Any word on a new method to do this or a way to vote for this feature?
     
    Last edited: Apr 1, 2022
  3. tcshaw91

    tcshaw91

    Joined:
    Jul 26, 2018
    Posts:
    7
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    This feature is already available. It's called Contact Modification.

    https://docs.unity3d.com/ScriptReference/Physics.ContactModifyEvent.html for example. Previously, I've used it to create completely custom colliders out of maths, holes, change the physics response before the physics engine resolves it and so on.

    This is usually the done thing - to modify the contacts before the solver moves them apart and so on - to define a new truth, if that makes sense.

    Some things it's useful for:
    • ignoring collisions
    • custom responses
    • custom collision shapes
    • water / other
    • tools
    You get the idea.
     
  5. vizgl

    vizgl

    Joined:
    Nov 4, 2014
    Posts:
    61
    That great feature, but most of dev's still on the 2020 unity versions
     
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,321
    I'm not sure where you've got that information from but it's certainly not true.
     
  7. EnokV

    EnokV

    Joined:
    Apr 14, 2016
    Posts:
    56
    So this thread is still alive, huh. I'm pleased to see quite a few new additions since the last time. Recently got back to toying with Unity and dove straight into character controllers of course, although 2D this time and it's been mostly straight forward.
     
    Last edited: Dec 23, 2022