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

How we can create collision system like the way Unity do?

Discussion in 'Entity Component System' started by UNDETON, Dec 24, 2018.

  1. UNDETON

    UNDETON

    Joined:
    Aug 20, 2018
    Posts:
    8
    Hi everyone!
    I get started to ECS and stop at collision detection, i see alot of video about collision detection in game in youtube. But i I can't implement it in real. What we check at this frame,
    when something move we check position of all the object this they touch something?.
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    There is spatial, or some form of octree, which allows to check pairs of near, therefore colliding object. Testing for overlapping bounding boxes may be first stage of check, before checking actual intersecting faces, between object.
     
    UNDETON likes this.
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    Unity collider use physx, and you need some form of tweening / syncing entities with game objects, and their colliders.

    With octree, that is only one stage, not to mention actual mesh intersection algorithms. Basically you need write own physics. Plus If you want actually colliders to bounce etc, that extra job on top. You can try using current ECS physics by @pilsa PhilSA if I spelled right name.
     
    Last edited: Dec 29, 2018
  4. Deleted User

    Deleted User

    Guest

    @PhilSA
     
    Antypodish likes this.
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    ECS seems currently too challenging for you. This doesn't mean you can't benefit, just it's just way too early in ECS development with not enough tutorials. It's not meant for beginners or even medium developers at this point. You have to be quite experienced because of the lack of documentation and changing API.

    So expect it to challenge you constantly, and how much of current Unity do you know? I mean if you're not familiar classic Unity itself, try that first.
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    Thx, my mobile does not show @ auto complete.
     
    Deleted User likes this.