Page 2 of 2
Re: Sensor but with collision
Posted: Sun Jul 30, 2023 1:36 am
by togFox
This project has opposing swarms pass through each other and bullets will pass through each other but enemy bullets will collide with enemy ships.
https://github.com/togfoxy/SpaceFleetBattles
Re: Sensor but with collision
Posted: Sun Jul 30, 2023 1:31 pm
by Ross
You want two different behaviors, so:
Option 1: Add two fixtures to your players and enemies—one "solid", one sensor.
Option 2: Add three lines or so to your preSolve function to check the object contacted and ignore the contact if necessary. (But this would make it more difficult to tell when the collision begins and ends, if you need that.)