Peoples emotions are contagious. It's just like when someone yawns, it makes you want to yawn too. Same concept. So if your with someone and they are in a bad mood, it will put you in a bad mood too. Same thing goes for being unmotivated, that person will make you unmotivated too.
This is why they say to choose your friends carefully. Hang out with creative, motivated, happy, supported people. They will unintentionally help improve you life without even knowing it. Try to do this with the people you follow on social media too. Any one you choose to have in your life in one way or another (unless they are family and your underage) make sure they improve your life somehow.