In C++ you can use UWorld::GetWorldSettings or AActor::GetWorldSettings. Neither is directly exposed to Blueprint though as far as I can tell. However in Blueprint you should still be able to get the WorldSettings actor by using a “Get All Actors Of Class” node. Note that these types of nodes may have a performance impact if you run them too frequently (for example in tick). You should therefore probably do that once and store the result for use later on.