Search Unity

Unity.Physics vs Havok Anomalies

Discussion in 'Physics for ECS' started by ippdev, Feb 14, 2020.

  1. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    I am creating Archetypes and emitting them. If I use Unity Physics they will bounce and keep going till using all energy up. If I switch to Havok the balls bounce a bit and then immediately begin pooling around where the bounce occurred and lose all linear velocity. In both scenarios the balls do not "roll" they just move to the next simulation position. Havok gives me 190FPS avg and Unity Physics gives me about 165FPS avg. In Havok if I roll a converted and injected ball across an arena floor it will "roll" smoothly. In Unity.Physics it often hit an edge normal and went 90 degrees straight up.

    So I probably need to set some flag or variable or not set some PhysicVelocity or PhysicsMass value correctly. Can someone chime in and give me a clue on what these anomalies are when creating an archetype from code that should "roll"..have some surface friction or surface angular velocity or whatever.
     
  2. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    This part should explain what is happening there (doesn't explain why Havok works better without the extra workaround mentioned on the video but this is really common physics simulation issue in general):
     
  3. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    I get the edge normal stuff. I was just testing balls and if I create one from a gameObject and Convert with just Unity.Physics body and shape it rolls. With Unity PhysX collider it doesn't then does after some tries or not. With a Rigidbody it won't roll either. So I cannot create one from an archetype that rolls. In fact they have downright weird behaviour and pool or hit a curved wall and bounce directly back..not reflect but back along it's trajectory...Unity or Havok physics.
     
  4. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    Are you able to show some videos of the action or a sample project to try? For example, is there anything I can drop into the UnityPhysicsSamples project to see what you mean?