Load Map with Reference

I’m unfamiliar with the format you’re using, but this worked for me:

FName LevelName = "/Game/Maps/TestLevel";
UGameplayStatics::OpenLevel(GWorld, LevelName, false);

Otherwise, if “ElvenRuins.ElvenRuins.umap” exists, I’m not sure what’s going on. Are you sure the error comes from the line you listed?

Can someone explain me how to load a map via its path in the content?

I have made some search and found this but it fails:

UGameplayStatics::OpenLevel(GetWorld(), "World'/Game/Map/ElvenRuins/ElvenRuins.ElvenRuins'", 0, "");

It gives me this error at runtime:

71212-untitled.png

I do not get what is going on :S

I have changed my code as you suggested:

UGameplayStatics::OpenLevel(GetWorld(), "/Game/Map/ElvenRuins/ElvenRuins", false);

But still getting the same error.The url in the code is true. I dont understand why it mentions another map url in my content :S

Ok wait it worked! I think it was a hot reload bug. The solution you gave me is correct. Please post your format as answer. I will mark as solution.