The attack system confused me as well, but I believe the goat just auto attacks when in range. And you can ensure that the game actually knows you want to be attacking by targeting the enemy (RMB) once you're in range.