#How to create a simple 2D collision system?

6 messages · Page 1 of 1 (latest)

mint kiln
#

My use case is very simple; I'm trying to figure out how to have simple collisions where I can detect if the collision just happened, akin to the Is Trigger and OnTriggerEnter2D() in unity. Would I be better off using a library for this? if not, how would I implement this? Would I need to store a list of other colliders each collider is currently inside, etc?

sand parrot
#

For a Serious Project, I would probably use bevy_rapier2d

#

Or another one of the 2D physics crates 🙂

#

But for learning, I would start with a query over the colliders

#

And use iter_combinations

#

and then generate collision events