There's a lot at play here.

Here are just a few notes that come to mind, based on what I've extracted from your comment. They are designed to try to get you to ask yourself, "What is the root cause of my lack of motivation?" They may or may not be on point or specifically applicable, but again, take them as potential "candidate questions", if you will, to get you thinking toward solving the problem.

1. You have a child on the way. As a parent myself, that's an absolute game-changer, and you could be subtly stressed about this. Becoming a parent affects different people in different ways. It's possible that you are mentally focusing more on that upcoming area of your life, and so the motivation to stay connected at work is subtly fading.

2. In conjunction with #1, you mentioned that you live in a high-cost city. That, coupled with the fact that you are going to become a parent, could be causing stress. You may feel that there isn't enough money, and this could be subtly impacting your motivation.

3. I take it that you are a software engineer that worked up through the ranks and are now leading a project. Is it possible that you miss being a developer? That is, are the stresses of managing the project, "talking to mangers and product people" pulling you away from your love of the code, such that it's absolutely draining your motivation?

4. Alternatively, if you're in a "mixed role", where you both code and manage, maybe you are suffering from the fact that all of the product meetings and discussions are killing your productivity, so your backlog just keeps getting larger and larger. If so, that of course can be a deep cause of stress, despite having full control of your schedule, and having all other aspects of your position be copacetic.

5. Are you just flat-out burned-out? Do you need a vacation? It could be that you need to step away and recharge.

6. Is it possible that you have become unmotivated because of your comparisons to your colleagues who have went on to become millionaires? Admittedly, this is of course a very difficult comparison, but if this is affecting you, you will need to work at letting it go. This will poison your Will. There is no other way except to keep fighting, and to keep working on what you define to be important for you.

7. Are you taking time out to exercise and eat right? I'm talking about lifting heavy weights, cardio, yoga, etc. In my experience, this is vital to reconditioning the mind, revitalizing the soul and improving your outlook.

8. Finally, do you still love what you do? This is an important, but potentially tough question to ask yourself in an honest way. That is, if none of the above are factors, it could be that you need a change of season in your life. I've written about this before, but in my personal experience, motivation is secondary (but closely related) to passion.

Generally, when one has an issue with motivation, then he or she may not have discovered his or her true passion in life.

You have to find your passion.

If you do not find it, then it is likely that you will never be truly motivated.

However, once you have found your passion, then you will find that it is literally game on in your life. You will wake up earlier, because you have engaged passion in your life, which will bring motivation to your actions. You will be bringing the thunder. You will be firing on all 12 cylinders. You will not want to sleep more than is necessary, because you will know from deep within you, that you want to bring what is inside of you to others, and to the world.

Ask yourself:

1. "What am I truly passionate about?"

2. "How can I deliver what I am passionate about to others?"

Answer these questions, back the answers up with action, and you will see motivation unfold in your life.

I wish you every success.