Due north
A character's moral compass is the backbone of character development. One of the more critical parts of your story is how, when, and where, you define your character's moral boundaries. If your story takes place in a modern day, middle-class suburb this probably isn't quite as crucial as it would be for someone writing in a fantasy or dystopian world. However, it still defines and connects your character to the reader in a deeper way.
Lets say your protagonist, we'll call her Sasha, is an ex CIA operative who found out about some dirty dealings and is now a fugitive. She discovers that the man who killed her parents was a CIA operative and of course, as always happens, she is presented with the decision to kill him. He and his daughter are tied up in their living room and she's got her finger on the trigger. So what does she do? What happens then? Well that all comes down to how you reveal her moral compass.
If throughout the entire novel she has sought vengeance for her parents death then you would assume that she would kill him. However, if you reveal that she has sworn to not be like the man how murdered her parents it is much more likely that she would stick to her morals.
But here's the fun part, you don't have to stick to someone's moral compass. Thats where character arc comes in.
Maybe she starts out searching for vengeance. Dead set on the fact that she will kill the man who murdered her parents. However, maybe through the amount of death she sees or through someone she meets, she decided that she's seen enough death and walks away. Or if she was adamant that she would never be like him. But after weeks of death and horrors that he was all apart of, she doesn't care anymore and she shoots him.
So many possibilities!!!!
Here are some interesting examples of complex moral compasses:
-~-~-
Morally gray: A character who does too much bad to be a good person, but does too much good to be a bad person.
Sympathetic villain: A character who is a bad person, but whose backstory/character arc makes you feel sorry for, or sympathetic towards them.
Anti-hero: A character who does bad things to achieve a good goal.
Anti-villain: A character who does bad things to achieve a goal that they believe to be good, but is actually just messed up.
-~-~-
These four compasses, though hard to write, are so much fun. They create very complex characters with in depth backstories that are simply a joy to write or read about. However, there are wrong ways to do some of these characters.
-~-~-
Abusive hero: A character who, while on the right side, is either physically, emotionally, or mentally abusive to those around them simply to seem 'tough'.
Cardboard villain: A character who does bad things to achieve a bad goal but has one throwaway line about a hard childhood that is expected to put them into one of the aforementioned categories when in reality it just makes them annoying.
The traitor: A character who starts out as a hero/villain, and seems like a hero/villain for the longest time, only to betray their cause for a vague reason. They then maybe receive redemption by sacrificing themselves.
Robotic villain: A character who is bad to be bad. A one dimensional villain. There's no reason they are what they are besides the fact that they think it's fun.
-~-~-
While these may seem obvious on paper (or screen for that matter) when you attempt to write one of the first four compasses it is easy to accidentally fall into one of the last four. Each of the latter compasses are actually watered down versions of the former, Morally gray - Abusive hero, Sympathetic villain - Cardboard villain, Anti-hero - The traitor, and Anti-villain - Robotic villain. Like I've said before, it is crucial to create a two-dimensional character when you apply any of these moral compasses. Lack of dimension will cause any of the first four compasses to morph into the lesser, much more annoying compasses.
While we think of a hero's moral compass pointing due north, there is always a bit of leeway for where the needle lands. Which begs the question, where does your needle point?