Search Unity

[Bug Report on Unity.Physics] CollisionFilter Setting of PhysicsShape

Discussion in 'Entity Component System' started by ilyaylm, Apr 18, 2019.

  1. ilyaylm

    ilyaylm

    Joined:
    Aug 20, 2015
    Posts:
    19
    I've struggle with this 2 days.....
    and finally figured out that there is miss naming with 'PhysicsShape' Script. In CollisionFilter part.
    physicsshape1.PNG
    physicsshape2_LI.jpg
    physicsshape3.PNG

    physicsshape4.PNG

    I've set PointDistanceInput's CollisionFilter : Belong(maskbit) : enemy(1<<1) ,
    Collidewith(Categorybit): player(1<<0)
    And Get Hit, then get Hit's Collision Filter inform.
    Finally I found that 'PhysicsShape > CollisionFilter' <BelongTo> and <Collide With> are changed each other.
     
    Last edited: Apr 18, 2019
  2. siggigg

    siggigg

    Joined:
    Apr 11, 2018
    Posts:
    247
    Actually I think you have that reversed?

    The code docs state:

    // A bit mask describing which layers this object belongs to.
    public uint CategoryBits; // TODO rename?

    // A bit mask describing which layers this object can collide with.
    public uint MaskBits; // TODO rename?
     
  3. ilyaylm

    ilyaylm

    Joined:
    Aug 20, 2015
    Posts:
    19
    Yeah. That is weird point for me too. But in the Manual.
    https://docs.unity3d.com/Packages/com.unity.physics@0.0/manual/collision_queries.html
    upload_2019-4-20_0-54-45.png

    You can See MaskBits is "Belongs".
     
  4. ilyaylm

    ilyaylm

    Joined:
    Aug 20, 2015
    Posts:
    19
    Package comment makes sense better. And idk why i couldn't think about looking into package...i'm...fool..

    ps. plz edit that doc page inform.
     
  5. siggigg

    siggigg

    Joined:
    Apr 11, 2018
    Posts:
    247
    Yeah those official docs are clearly wrong :)
     
  6. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    761
    Dammmmmn.... that must have been so frustrating!