Search Unity

Triggers

Discussion in 'Entity Component System' started by Ziboo, Mar 21, 2018.

  1. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Hi,

    What would be the correct solution to catch OnTriggers events with the ECS system.
    In the TwinStickSample they only do a radius check.

    Can we access the physics triggers event through systems ?

    Thanks
     
    Dennin-Dalke and laurentlavigne like this.
  2. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    bump
     
  3. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    I have not tried it, but I guess at the moment that would be a "hybrid" solution.

    I.e.
    - you create a component which has a "trigger indicator" and is accessed by the ECS systems
    - this trigger indicator is set by a monobehaviour class attached to the entity, which implements the unity magic methods / interfaces to catch the trigger event
     
  4. Krajca

    Krajca

    Joined:
    May 6, 2014
    Posts:
    347
    I think for now you need to implement your own solution until all features get integrated with ECS or use mentioned hybrid solution.
     
  5. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    @sngdan is right.

    ATM you have to either rely on a Hybrid approach or write the collision code yourself. As we move forward we will add compatibility with more and more systems. Physics and collisions are on top of our priority list.
     
    FROS7 likes this.
  6. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Lovely, and if you could, expose all spatial query mode, like "closest hit" which would save extra distance sorting, good for AI.