• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Only trigger collision event when colliding with specific collision group

Bart

WiseBart
Hi all.

Recently I've been working on physics collisions on multiple levels using Box2D.
To achieve that, I define each level's collision mask with a different positive collision group (>0).
When the z value passes the midway point (half level height), I unbind the player's fixture, change its collision group and rebind it.
This works perfectly when no collision event is required.

Objects that need interaction, however, require a collision event.
As a consequence, the collision event is also triggered on collision with instances of a different collision group. Which is precisely what I'm trying to avoid since they're "on a different level".

Is there any way to only trigger the collision event when colliding with fixtures that are part of a certain collision group?
It seems that once you define a collision event in an object, this overrides any collision group setting.
I especially like to avoid having to check things like:
Code:
// Object's collision event
if (level != other.level) exit;

// Further code goes here...
Basically I'd like the above if check to be implict in the underlying wiring.

Anyone who has experience with this?
 
Top