For the past few months, I've been trying to figure out a solution for a problem I'm having (anybody in the almightyzentaco Discord, may have seen me bring this up). I've been trying to do some tweaking on a project that I've been hard at work on for a few years, and though I'm almost finished in many aspects, there's one thing that has me stomped. See, this game works just fine on the PC, but I want to have a mobile version as well, and that's where things get messy. I have it set up to where enemies spawn every so often and you must tap (or click) on them to destroy them. At first I had no hitboxes for these enemy objects, as the collision worked just fine on the PC. It was only when I tested the level out on mobile, that I realized that I couldn't tap certain enemies (they vary in size).
I didn't want to try to implement hitboxes so late in development, as it would take a lot of time, but I realized there was no real way around it, so I set about doing just that. And this is where's where the headache began...here's a brief rundown of what I'd done.
Firstly, upon implementing the hitboxes, I noticed right off the bat that not only was everything a completely scattered mess visually, upon clicking on one hitbox, nearly all of the enemies on screen would get attacked or destroyed or nothing would get destroyed.
So I figured doing a Spread Value (both the sprite and hitbox set to 0) would fix some of this and it did...sort of. I was able to get the hitboxes and sprites to position just fine. But there was still some other aesthetic issues, such as some of the sprites facing in a direction that was opposite of where its respective hitbox was moving (i.e. hitbox moving the left, and the sprite facing right). With some help, I was able to resolve the sprite directional issue. But there's still the issue of both the hitbox and sprite not getting destroyed when being tapped/clicked. What also happens is that sometimes merely the hitbox is destoryed, but never both the hitbox and sprite. The tap/click is registered, since the score increases as it should, but I'm not getting the result I'm looking for.
TL : DR what I want is to spawn enemies every "x" amount of seconds, and tap to destroy each one (thus scoring). Initially no hitboxes were used, since everything worked fine without them, on the PC. Porting to mobile is where I realized hitboxes were necessary, and now the the enemy behaviors are completely in a disarray, due to the hitbox collision not registering, as well as the aforementioned aesthetic issue of the sprites not facing the where the hitbox is moving.
Here's some screenshots from an example MFA (I always whip up dummy MFA's, when I run into certain issues, so as not to further destroy the actual project lol)