"The character was just one dimensional."
"The characters just didn't feel real."
Why do readers fall in love with a story? Or watchers, or listeners? There are many reasons of course. There is good grammar. There is well described visual scenes. There is the action packed moments that make hears pound.
But first and perhaps foremost there are good characters, Real characters, characters that (no matter how fantastical the setting) make smile and say, "I know that guy." Surely we all had a bright and enthusiastic friend who was disillusioned with their simple home life and wanted to get out in the world. We've all known a Luke Skywalker. We've all cringed in sympathy with that friend that just didn't get it socially. We've all known a Data.
No matter how fantastical the setting the characters we expect the reader to interact with must be relatable. They must be human. Wile life experience is the best fodder for this, write what you know and all that, there are some tools out there that help you build realistic characters.
Here is a good site that describes what most psychologists call the BIG 5 character traits and shows how they can balance in a person.
One good way to use it is to take the test yourself and see how the five variables balance out in yourself. Then read the literature and tweak the numbers for your characters like you were building a D&D character.
For those who don't want to spend the money to take the whole test the variables are very well described in the associated literature and it is fairly easy to work from them.
There are other measure out there to use but the big 5 traits and the ten subdivisions have some of the best science backing them up.