Disabling collisions for an individual object

0 favourites
  • 4 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I have two object types: Object A and Object B, both with a Physics behavior.

    I have copies of Object A in one layout, but I want to disable only the collisions with an Object B but in one of the copies of Object A, not all of them, or globally. Using the Enable/Disable Collisions in the category Physics: Global Settings disables the collisions with Object B in all of the copies of Object A, and I just want to disable them in one of the copies of Object A.

    Is there a way to individually change this?

  • sigh, while Box2d does support collision filtering. The C2 plugin does not. I know it's been mentioned as a request, but the implementation might be a little while.

    "Filtering

    Collision filtering allows you to prevent collision between fixtures. For example, say you make a character that rides a bicycle. You want the bicycle to collide with the terrain and the character to collide with the terrain, but you don't want the character to collide with the bicycle (because they must overlap). Box2D supports such collision filtering using categories and groups.

    Box2D supports 16 collision categories. For each fixture you can specify which category it belongs to. You also specify what other categories this fixture can collide with. For example, you could specify in a multiplayer game that all players don't collide with each other and monsters don't collide with each other, but players and monsters should collide. This is done with masking bits. For example:"

    box2d.org/manual.html

    I would like it because it would allow an easier mdoel to do physics jumthru.

  • Thanks for the advice! I'll consider it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What about throw in an instance var and have a custom condition to filter? Slightly messy but possible option.

    Brett

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)