Why do I get zero damage on enemies at the gates, but only sometimes?

I am playing huntress, and probably like most I often camp one of the gates at the beginning of a wave. I've notices that I can shoot into the gate and hit enemies as the come out. Sometimes this does zero damage, and other times it does not. Why does this happen?


Solution 1:

There is a zone of invincibility around the spawning areas to prevent towers blocking spawns completely and killing them easily.

However, If the enemy is a ranged unit, then you can damage them even though they are in the zone of invincibility, if they decide to target something to fire on. This is to prevent ranged units from getting stuck inside and constantly trying to attack you through a wall and thus preventing the map from being finished.

The zone is the purple area around where they spawn.