It's designed to only shoot when in idle mode, what I mean is that when you shoot using the spacebar you only press the spacebar and nothing else to successfully shoot at all.
It's a game mechanic, also thanks for playing my game !