Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AssetDatabase.CreateFolder

static function CreateFolder(parentFolder: string, newFolderName: string): string;
static string CreateFolder(string parentFolder, string newFolderName);
static def CreateFolder(parentFolder as string, newFolderName as string) as string

Parameters

parentFolderThe name of the parent folder.
newFolderNameThe name of the new folder.

Returns

string The GUID of the newly created folder.

Description

Create a new folder.

		string guid = AssetDatabase.CreateFolder("Assets", "My Folder");
		string newFolderPath = AssetDatabase.GUIDToAssetPath(guid);