Melee weapons take stamina. If you're running low on stamina, you might not be able to attack, until it regenerates a bit.