Hi,
I’m searching how to modify the collison filter during game. By the forum, i have find this (physics.removeBody and addBody ) But that don’t work. have you a better solution ?
local littleCharacterCollisionFilter = { categoryBits=2, maskBits=3 } -- the default behavior local characterCollisionFilter = { categoryBits=4, maskBits=5 } -- the next behavior --event.other have the littleCharacterCollisionFilter local function onCollisionBetweenCharacterAndLittle( event ) target=event.target if ( event.phase == "began" ) then if ( event.other.myid == 4 and event.other.isVisible ) then physics.removeBody(event.other) physics.addBody( event.other, { density=.5, friction=1, bounce=0.7,shape=pentagonShape, filter=characterCollisionFilter } ) end end end character:addEventListener( "collision", onCollisionBetweenCharacterAndLittle )