Is it better to have one local collision function for all object category?

Hi everyone! I would love to consult your advice.

Let us consider these objects as an example:

Hero(will collide to all category but not to it self)

Moving Enemies(will collide to the Hero only)

Harmful/spiky objects(will collide to the Hero only)

Gifts - like bonus or coins(will collide to the Hero only)

Is it better to have 1 local collision function for each object category? Or, is it better if each category has its own local collision function? Or, what are your suggestions? Thank you.

Howdy!
Probably one collision listener and filter the collisions using categoryBits.

You can read all about it on this guide:

1 Like

Thanks Sui.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.