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

DOTS Physics: Dynamic objects will not settle on other dynamic objects

Discussion in 'Physics Previews' started by Soaryn, Mar 19, 2019.

  1. Soaryn

    Soaryn

    Joined:
    Apr 17, 2015
    Posts:
    328
    As demonstrated in the gif below, any dynamic physics body that comes in contact with a static physics body, stop as intended with the expectation from Neuton's 2nd law; however, when a dynamic body attempts to settle on another dynamic body, it seems to fight back a bit resulting in bouncing effects. This happens with varying values of friction and restitution as well. It occurs in new empty scenes with minimal components as well as the samples provided.
    bounce.gif


    Question: Is this a bug? Or is there something we need to do in addition to handle multi dynamic object collisions to create, for example, piles of objects?
     
    macagu and PhilSA like this.
  2. Soaryn

    Soaryn

    Joined:
    Apr 17, 2015
    Posts:
    328
    An example of the physics sample of this occurring:
    exampleMovement.gif
     
    macagu likes this.
  3. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    Can you validate that the physics sim really runs on fixedupdate and not regular update? Many ECS systems are meant to run by default in fixedUpdate world in the future versions of Unity, but I think right now this whole simulation/presentation worlds thing is not ready yet and they might just be running on Update
     
    AlanMattano and e199 like this.
  4. e199

    e199

    Joined:
    Mar 24, 2015
    Posts:
    101
    Yep, it does run in Update for now
     
  5. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    Yes they in Update and this why you can see in examples, sometimes simulation faster or slower, depend on framerate :) It looks funny :)
     
  6. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
  7. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    That's a good sign, because it means the bug is easy to solve! (Maybe)

    Simply making physics run on fixedUpdate might slove stability issues. This is most likely something unity is aware of and they were just waiting for the simulation/presentation world setup to be ready

    Since UnityPhysics wants to be deterministic, it is literally impossible that it was actually meant to run on update

    See this post: https://forum.unity.com/threads/why-is-simulation-the-default-system-group.639058/#post-4298449
    right now we are in the "next" release of Entities that he speaks of, where FixedUpdate doesn't work yet
     
    Last edited: Mar 19, 2019
    AlanMattano and e199 like this.
  8. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    I wouldn't expect physics moving to a fixed update loop (whenever that even happens) to fix this. Referring again to the blog post, it implies that the lack of caching in the Unity physics package limits suitability for "complex scenarios" such as stacks of dynamic rigidbodies.
     
  9. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    It will. All simulation group will be moved to fixed update (it was actually but changed in 0.0.28 ECS preview but temporary) https://forum.unity.com/threads/why-is-simulation-the-default-system-group.639058/#post-4289911