diff --git a/Source/Engine/ContentImporters/CreateJson.cpp b/Source/Engine/ContentImporters/CreateJson.cpp index 6141cb03e..fb7d3f6e7 100644 --- a/Source/Engine/ContentImporters/CreateJson.cpp +++ b/Source/Engine/ContentImporters/CreateJson.cpp @@ -41,6 +41,18 @@ bool CreateJson::Create(const StringView& path, StringAnsiView& data, StringAnsi LOG(Warning, "Asset will have different type name {0} -> {1}", typeName, String(dataTypename.Get())); } } + else + { + const String directory = StringUtils::GetDirectoryName(path); + if (!FileSystem::DirectoryExists(directory)) + { + if (FileSystem::CreateDirectory(directory)) + { + LOG(Warning, "Failed to create directory"); + return true; + } + } + } rapidjson_flax::StringBuffer buffer;