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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Where is the HitBoxOverlapResults?

Discussion in 'Project Tiny' started by Reborn1214, Jun 17, 2019.

  1. Reborn1214

    Reborn1214

    Joined:
    Jan 19, 2019
    Posts:
    15
    I can't find this component.How should I detect collisions ?
    hitbox.PNG
    Unity 2019.2.0b3
    TinyProject 0.15.3
     
  2. Frickinlaser

    Frickinlaser

    Joined:
    Jan 19, 2014
    Posts:
    22
    Yeah, the documentation is probably not updated. It's only called HitBoxOverlap and is attached as a DynamicBuffer.
    You can access it and loop over it like this:
    Code (CSharp):
    1. Entities.ForEach((Entity entity, DynamicBuffer<HitBoxOverlap> hitBoxOverlaps) =>
    2. {
    3.    for (var i = 0; i < hitBoxOverlaps.Length; i++)
    4.    {
    5.       if (hitBoxOverlaps[i].otherEntity //something something)
    6.       {}
    7.    }
    8. }
     
  3. Reborn1214

    Reborn1214

    Joined:
    Jan 19, 2019
    Posts:
    15
    Thank yous,It's useful