Invalid attempt to detect collision from CollisionTube!

It’s my code:

初始化障碍物

base.cTrav = CollisionTraverser()
# 碰撞检测
self.collHandEvent = CollisionHandlerEvent()
self.collHandEvent.addInPattern('%fn-into-%in')
# 被拳头打到后,直接交给 FSM 处理
self.accept('body-'+name+'-into-hand.R',self.request,['Beaten']) ### 'name' is 'P1' or 'P2'
# 这是身体碰撞的处理。
self.accept('body-P1-into-body-P2',self.request,['Bodycollide'])
self.accept('body-P2-into-body-P1',self.request,['Bodycollide'])

# 碰撞固体
tube = CollisionTube(0, 0, 0, 0, 0.5, 0, 0.2)
cNode = CollisionNode('body-'+name) ### 'name' is 'P1' or 'P2'
cNode.addSolid(tube)
cnodePath = self.avatar.exposeJoint(None,"modelRoot","hips").attachNewNode(cNode)
# 掩码
if(name=="P1"):
	cnodePath.node().setIntoCollideMask(BitMask32(0x02))
	cnodePath.node().setFromCollideMask(BitMask32(0x01))
else:
	cnodePath.node().setIntoCollideMask(BitMask32(0x01))
	cnodePath.node().setFromCollideMask(BitMask32(0x02))
base.cTrav.addCollider(cnodePath,self.collHandEvent)

When first collisde happend, it tell me:

Simply put, you’re not allowed to use a CollisionTube as a “from” object - you may only have things collide into it.

Note, in case you missed this point, that you’re not expected to put every collider into the traverser - only those that are intended to be “from” objects. Indeed, even barring such issues as you’re having, attempting to make all collision objects be “from” objects is likely to be inefficient.

If you are confident that this object should be a “from” object, then perhaps try a different collision shape. A set of CollisionSpheres might work, or perhaps CollisionSegments; CollisionBox might work - I don’t see mention of whether it’s a valid “from” object, I’m afraid.

OK, I should try to Bullet. Thank you!