Search Unity

Collisons Events Between Children

Discussion in 'Entity Component System' started by Filter_Feeder, Aug 9, 2021.

  1. Filter_Feeder

    Filter_Feeder

    Joined:
    Oct 19, 2017
    Posts:
    45
    I'm trying to get collisions between children of different entities (to clarify, several entities have one child, when children from different entities collide, I want X to happen). I have a working event system set up and everything, but I can't seem to get around an issue where the game thinks all the children are colliding simultaneously, no matter where they are.

    Looking at my entity debugger, I notice that my children (which have a parent component and a LocalToParent component) all have the same translation (some value which just specifies how much it is offset form the parent), and perhaps the collision system uses the translations rather than the localtoworld? Maybe that's a stupid idea.

    Has anyone else had problems with this?
     
  2. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    Not sure if this is what you are getting at but the physics conversion deparents any non static rigidbody, and at runtime physics only uses the translation & rotation and ignores the finer workings of the(entities) transform system.
     
  3. Filter_Feeder

    Filter_Feeder

    Joined:
    Oct 19, 2017
    Posts:
    45
    Does that include Kinematic entities?
     
  4. Filter_Feeder

    Filter_Feeder

    Joined:
    Oct 19, 2017
    Posts:
    45
    I did just for the sake of trying, remove the parent-child relationship and tried to see if the children could collide and trigger events on their own (obviously not actually being children anytmore at this point), and they work just fine. This makes it seem like child-parent relationships is pretty much a no-go if you want them to trigger events.