Just thinking about it blows my mind. Knowing that you are in the direct line of fire with no sandbags, no body armor and no reliable cover, wearing bright colors that don't blend in the environment and put together in a rigid formation. How do napoleonic era (I'm using this era since it's more synonymous with flintlock warfare) soldiers even have the will to stand directly at the enemy and just hope to not get shot?
I've written extensively on this topic, and you'll likely find what you're looking for in some of my older answers:
What motivated 19th Century soldiers to endure such terrible hardships?
Why would anyone stand in the front row of a column?
How did Napoleonic era soldiers stay calm under fire?
How often did Napoleonic soldiers have to run during a battle?
And, as always, I'm happy to answer followups.