Collision Group changing not works

Collision Group changing not works
0
#1

I have a node with PhysicsBoxCollider and changing collision group of node not take effect once the Node is created

I change collision group from following code
node.group = "collision_group_name";
It only effects the rendering properties of cullingMask but not effect the collision group in physics world

If I directly change the box2D fixtures collision filters then it take effect…

Node.getComponent(cc.PhysicsBoxCollider)._fixtures[0].m_filter.categoryBits = 4;
Node.getComponent(cc.PhysicsBoxCollider)._fixtures[0].m_filter.maskBits = 27;

I guess on changing collision Group with this code node.group = "collision_group_name"; only take care of rendering part but misses changing it in Box2D world

0 Likes