Ignore collisions by type of Entity
Posted: Fri Jul 26, 2019 5:56 pm
What's the best way to turn off the collisions between objects of certain types?
This would be for cases such as "No players should ever collide" or "No projectiles should ever collide" as well as "No Players of Team A should collide with projectiles of team A".
I started by building out groups to handle this, but it gets tricky in a deathmatch scenario. Then I need groups for Team A, Team B, C, D, etc. And groups for their projectiles, etc. In this case Player Team A has NoBroadphase with Proj Team A, Player Team B, C, D, etc.
Other option is as I add new Characters/Projectiles to the space, I can run through the already existing characters/projectiles and create rules via CollisionRules.AddRule accordingly.
Is there an easier way I'm missing?
This would be for cases such as "No players should ever collide" or "No projectiles should ever collide" as well as "No Players of Team A should collide with projectiles of team A".
I started by building out groups to handle this, but it gets tricky in a deathmatch scenario. Then I need groups for Team A, Team B, C, D, etc. And groups for their projectiles, etc. In this case Player Team A has NoBroadphase with Proj Team A, Player Team B, C, D, etc.
Other option is as I add new Characters/Projectiles to the space, I can run through the already existing characters/projectiles and create rules via CollisionRules.AddRule accordingly.
Is there an easier way I'm missing?