Apr 11 Update
Still working on first boss fight. Spent a lot (more than I would've liked) of time debugging issues with hit detection. This was mainly due to the IntersectRay method I was using to do raycasts for shooting enemies. It would just sometimes miss the colliders no matter what I did when it came to Area3Ds. There didn't appear to be a problem if the colliders were StaticObject3Ds. I'm still not sure what the issue is, but I found raycast3ds to be more reliable. On top of that, I swapped to having hurtboxes just send a signal to a database to store the enemy hurtbox inside it when the mouse entered the Area3D and remove on exit. Then I'd just call damage separately. This was extremely reliable and the player longer misses things as long as they click the hurtbox. However, I didn't want players to have to only click on enemies for it to register a hit, I wanted them to be able to click past an enemy and still hit them so long as the raycast hits, so I added some extra handling for that. In the end the RayCast3D ended up being used for obstacle detection and for anything in the way. Ultimately it ended up being a sort of hybrid solution to make sure I had reliable hit detection. Also got a chance to refactor some stuff so that's always good.
I still have to figure out some bugs with the projectile system (these are not immediate hits because the projectile moves slower) but that's a concern for later since I don't need it now.
Comments
Post a Comment