I have some enemies that want to avoid the light and some others that can go in the light.
In order to do this, I want to create/modify the areas of the navmesh at runtime on the spots where the lights are. My lights are spherical just like a sphere collider so using NavMeshObstacle I modify those areas>
HOWEVER these these areas are completely removed from the navmesh instead of having their layer modified like I would like.
Is there a way to modify layers of the navmesh at runtime based on a collider that moves on the navmesh?
Yes, you can have use Navmeshmodifier Volumes and change their layer settings. Depending on the size of your Navmesh and on the frequency of layer changes, you might run into performance issues. Afaik the navmesh baking is using DOTs already, so it’s expected to be really fast.