I wanted a set of enemies that move vertically through the air and changed direction at a predetermined point, I managed to get an enemy moving vertically and changed OnTriggerExit2D to OnTriggerEnter2D.
I made some game objects with box colliders to work as invisible wall - though I wonder if there’s a way to literally box them in to a specific area rather than place multiple walls around them…
The enemy just passed straight through them, after a lot of messing about (and somewhat out of desperation, really not thinking it would work) I changed the layer of my invisible wall to ‘Ground’ suddenly it worked, but there’s no mention of the ground layer in the enemy script I really don’t understand why that worked??
I then added an EnemyWall layer and changed it to that, this also worked, but if layer is set to default it doesn’t work, so I guess maybe I just don’t have a good enough understanding of how layers work?