I feel like there was an easier way...just by having enemies and walls be in different collision layers and then just using different layer masks for each area instead of checking what you collided into
Maybe, but by doing that, sure you can determine what layer whatever you hit is on. But the problem here was the size of the collider was too big. I suppose you could make it so that if the bullet collides with the wall it doesn’t destroy it, but then you have bullets that could go on endlessly. Sorry I’m just having a a bit of trouble understanding how this could be solved with layer masks
@@Conmama19 you create two collision shapes; a smaller one to interact with terrain and a larger one for interacting with enemies, just like on the video, then you just configure their layer masks and either handle the collision on the bullet, make the bullet emit a signal for each collider, so "on_damage_area_enter" and "on_terrain_contact" or just detect the area overlaps somewhere else in your game.
I would use the smaller collision shape for everything if I were you. There is no reason that to use a 'bigger than the sprite itself' collision shape for enemy collision.
But why not? Imagine the sprite overlaps an enemy you are aiming at, but it misses because the hitbox is too small. It makes for good game feel and a lot of your favorite PVE shooting games probably already do this.
@@ToonNoah Especially bullet hell games, The hit box on enemy bullets is way smaller than you would think, but bigger on the players. I mean it's kinda like coyote time for a platformer. Sure the game would be more realistic without it, but most people would agree that the game sucks without it.
@@vonvetur Didn't bother me either, but then I did just come from a Chopin compilation video. Hmm, I don't usually listen to Chopin, maybe the two are related somehow? :)