Need advice on collisions

Hi, let’s say I have 3 sets of collision checking: one for scenery, one for projectiles, the last one for walls. If time allows I’ll check for collisions with NPCs too

I got the first of them working with a CollisionHandlerQueue. I’ve been considering the use of CollisionHandlerEvent in the rest. Now I wonder if it’s possible working with several handlers by adding each collider to its handler or even whether it would be better doing all the collision logic with the same handler, despite I would have to rework the first collision check.

What do you think?

Hmm, is there anything that holds you back from just using the same handlers but different bitmasks?

There’s no particular reason to be conservative of handlers, but each collider (“from object”) may be associated with only one handler.

David

Hmm, I think I will keep the CollisionHandlerQueue for all, I suppose giving every set a different bitmask wil do the trick. The events thing seems handy but I think queue is simpler and I have part of the code with queue already. Thanks

CollisionHandlerEvent is useful as another way to filter collisions other than bitmasks. You can specify that an event will only be sent if the Into or From node has a certain tag. Found it useful for not having to process the CollisionHandlerQueue myself.