The Specter has the ability Incorporeal Movement, which states,
The specter can move through other creatures and objects as if they were difficult terrain. It takes 5(1d10) force damage if it ends its turn inside an object.
Does moving through a creature grant an opportunity attack to the creature it's moving through? It seems like it should, but that lessens the "coolness" of the ability.
Best Answer
It behaves like any other creature would.
The PB states that any creature that moves out of your reach provokes an opportunity attack (195):
If the specter moves through a creature and out of their reach, then it will provoke an opportunity attack. If it passes through a creature but stays within its reach, it does not provoke an attack. This is, of course, the same for any other creature.
If a creature can avoid opportunity attacks, it's explicitly listed in the listing. For example, the Giant Owl (MM 327):
Specters do not have such an ability, so they are subject to opportunity attacks if they move out of a creature's reach.
Compare to a ghost
It's worth noting that a ghost has a similar incorporeal movement ability and an Etherealness ability, which truly allows it to float through anything freely (MM 147):
This ability would allow the ghost to ignore any opportunity attacks (though it would still technically trigger them).