Not sure if this will be handled later in the course or not, but I noticed that you can shoot from inside (or on the other side) of colliders such as trees and foreground tilemaps. From what I can figure, that is because the arrow spawn point is beyond the player’s body collider and so if you press against the foreground object, the arrow will spawn inside. So that means the OnTriggerEnter2D() event doesn’t fire.
How would you deal with that?
I had a couple ideas.
Could try to detect of the arrow in spawning inside a enemyHealth/indestructible trigger collider, but not sure if there is an easy/efficient way to do so? Do some sort of ray cast…?
Could add a collider to the spawn point and flag whether you’ve entered or exited a enemyHealth/indestructible trigger collider? Issue I could think of for that is if the spawn point enters overlapping colliders.
I feel like there ought to be a better method, but I guess that’s why I’m doing the course. Hopefully it’s taken care of in a later lesson.
Thanks.