Categorybits and mask bits on the fly?

I have an object A sitting on a platform. When another object collides with it, I’d like object A to fall. I’m imagining that I need set the filter for object so that it ignores other objects, like the platform, after the collision. 

I don’t see any options for setting filtering after a body has been created. Would there be another way to create this type of effect? 

You could always have the collision trigger a change in the object to “isSensor = true”. That way, it’ll fall through the platform. I guess that would keep it from interacting with any other physics objects, but I think you should be able to reset the flag to “isSensor = false” during it’s decent.

Hi @soggybag,

As you found, there is no method to change collision filters after the body is created. So, you’ll have to do something like @Panc suggests.

Brent

Thanks that seemed to work well. 

You could also set isBodyActive=false on the platform.

You could always have the collision trigger a change in the object to “isSensor = true”. That way, it’ll fall through the platform. I guess that would keep it from interacting with any other physics objects, but I think you should be able to reset the flag to “isSensor = false” during it’s decent.

Hi @soggybag,

As you found, there is no method to change collision filters after the body is created. So, you’ll have to do something like @Panc suggests.

Brent

Thanks that seemed to work well. 

You could also set isBodyActive=false on the platform.