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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

ApplyImpulse vs Physx AddForceAtPosition

Discussion in 'Physics for ECS' started by snacktime, Jun 30, 2020.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,352
    I'm seeing a strong difference in behavior and wondering why.

    Hit this when I want to port our water buoyancy to DOTS. So with buoyancy the logic is create points to apply impulses to. With Dots the force is applied more locally is the best I can describe it. Physx has a tendency to stabilize and Dots seems like it just doesn't have that tendency. Guessing it's due to not being stateful?

    I'm testing one vs the other using the same algorithms for impulses that I used for AddForceAtPosition. Inputs can't account for the difference I'm seeing it's something more fundamental. behaviour is too different.
     
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    We did play with DOTS physics on the BoatAttack project and ended up with similar behavior.
    What Damping values do you have on your bodies? Can you share some animated gifs to show the different motion or code snippets to compare?
    Which ForceMode were you using in the original MonoBehaviour when applying the force?
     
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,352
    Ya this was my bad I had a calculation using quaternion.identity instead of actual body rotation. It actually works quite well now.
     
    Adam-Mechtley and steveeHavok like this.