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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved How to get impulse of a collision?

Discussion in 'Physics for ECS' started by Mushreb, Apr 28, 2020.

  1. Mushreb

    Mushreb

    Joined:
    Nov 14, 2018
    Posts:
    3
    Hi, I studied the UnityPhysicsSamples and I couldn't find how to get the impulse of a collision.
    How do I get the impulse of CollisionEvent just like the Collision.impulse of the old physics system? Thanks!
     
  2. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Hey, just call CalculateDetails() on your CollisionEvent and that will give you a Details object that has EstimatedImpulse field. You'll also get an AverageContactPointPosition, as well as an array of all contact points for more advanced analysis.
     
    steveeHavok likes this.
  3. Mushreb

    Mushreb

    Joined:
    Nov 14, 2018
    Posts:
    3
    Thanks a lot!
     
    petarmHavok likes this.