My main character is basically a good guy, but since he's a junkie, very often he acts mean, so you never know if you love him or you hate him. Do you think this is good for the story or maybe the constant change in his behaviour and reactions can lead to flatness?
I think it is utterly realistic. People rarely behave in a single manner throughout the course of a day. A junkie's behavior, in my experience, tends to change a lot depending on whether he's trying to get a fix, is coming, down, etc.
I have this same problem with one of my characters...he's never steady minded. I don't have the heart to write him off or redevelop him, he is such a vibrant part of my story... (The main characters best friend)...So, what I have found helps, is having my friend read the dialog out loud with me. This way, I can hear him outside of my head. It has helped center this characters focus firmly in relation to the story line. I think it helps when a character is complex, it brings a certain amount of realism to the story. All the best!
this is what happens when you dont outline your plot in detail before you begin writing. Try the less spontaneous approach to plot and you'll see this problem disappear. but, I'd say if you really enjoy this style, well then just let him do whatever he wants to do. cheers and good luck on this.
It's okay if the guy is moving around two poles, but make sure he's not totally all over the place. There are lots of characters out there the reader switches between loving and hating; they're some of the best. But make sure he's consistant--if the circumstances are the same in two situations, he should act the same in each situation (unless he's learned to do differently since then), for example.
Your character sounds perfectly normal to me. There are a lot of great characters out there who match your description. Take comic book characters for example. Bucky from Get Fuzzy, Calvin from Calvin and Hobbes...we love them, but only because we hate them too. I often roleplay an alcoholic werewolf that tends to bounce back and forth too. He started drinking for a Noble Cause. (He's a happy drunk, so he drank through the full-moon to avoid killing people.) Which led to him being drunk all the time. You know, just in case. Obnoxious. Whiny. Bad tempered. Hilarious...it works.
Maybe he's obnoxiously loveable? Really though people always act differently depending on situations. Who is around? Do they hate the people around them, like them? Maybe the MC is trying to impress someone? As yourself how you think someone would act in a situation and go from there. Few people have a concrete constant personality. They change behavior by curcumstance