NPC AI not moving after switching between levels

In project settings, setting RuntimeGeneration to True under Nav Mesh settings worked for me.