Sensor but with collision

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
togFox
Party member
Posts: 828
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Sensor but with collision

Post 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
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
Ross
Party member
Posts: 100
Joined: Tue Mar 13, 2018 12:12 pm
Contact:

Re: Sensor but with collision

Post 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.)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 8 guests