{"id":3450,"date":"2022-05-25T15:12:02","date_gmt":"2022-05-25T13:12:02","guid":{"rendered":"https:\/\/store.algosyntax.com\/?post_type=asx-lms-tutorial-cpt&#038;p=3450"},"modified":"2026-03-09T14:29:49","modified_gmt":"2026-03-09T12:29:49","slug":"tutorial-ue5-how-to-create-your-custom-asset","status":"publish","type":"asx-lms-tutorial-cpt","link":"https:\/\/store.algosyntax.com\/tutorials\/unreal-engine\/tutorial-ue5-how-to-create-your-custom-asset\/","title":{"rendered":"[Tutorial] UE5 How to create a custom asset type"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3450\" class=\"elementor elementor-3450\" data-elementor-post-type=\"asx-lms-tutorial-cpt\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1f04ef8 e-flex e-con-boxed e-con e-parent\" data-id=\"1f04ef8\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-f82d629 e-con-full e-flex e-con e-child\" data-id=\"f82d629\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-9f59f2f elementor-widget elementor-widget-text-editor\" data-id=\"9f59f2f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>This tutorial will cover creating a custom <a href=\"https:\/\/docs.unrealengine.com\/5.0\/en-US\/assets-and-content-packs-in-unreal-engine\/\" target=\"_blank\" rel=\"noopener\">asset<\/a> that will appear and be used in the unreal engine editor. There are two scenarios in which a custom asset may be made. Your goal might be to create an asset from reading a file in some other extension that unreal engine does not recognize. Or, You may like to create the asset by right-clicking in the editor and creating a new asset.\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0d037ed elementor-widget elementor-widget-heading\" data-id=\"0d037ed\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">How to import unsupported or new file extensions in unreal engine<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0ab9f93 elementor-widget elementor-widget-text-editor\" data-id=\"0ab9f93\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>We will begin by showing you how to import unsupported file extensions into unreal engine as custom assets. This means you will be able to select a file with some extension and unreal engine will be able to read it and create a new uasset from it.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-59f114b elementor-widget elementor-widget-heading\" data-id=\"59f114b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">1. Create Child Class From UObject<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b01ac5c elementor-widget elementor-widget-text-editor\" data-id=\"b01ac5c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Create a class that inherits from <a href=\"https:\/\/docs.unrealengine.com\/5.0\/en-US\/API\/Runtime\/CoreUObject\/UObject\/UObject\/\" target=\"_blank\" rel=\"noopener\">UObject<\/a>. The purpose of this class is to hold the data that gets read in from the new file. For example, lets pretend we had a file extension .bcg and we would like to read in data from these type of files. Our UObject could be named UBcgAsset.\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a746c49 elementor-widget elementor-widget-text-editor\" data-id=\"a746c49\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>TIP: Inside this object, you may want to store the original file&#8217;s path for later use. For example, if you would like to enable reimport functionality for your custom asset type you will need this file path. You can follow this link to <a href=\"https:\/\/store.algosyntax.com\/tutorials\/unreal-engine\/tutorial-ue5-add-reimport-support-to-custom-asset\/\">add reimport support to your custom asset type.<\/a><br \/><br \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d674058 elementor-widget elementor-widget-code-highlight\" data-id=\"d674058\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>#if WITH_EDITORONLY_DATA\r\nUPROPERTY(VisibleAnywhere)\r\nFString SourceBCGFile;\r\n#endif<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bde13b9 elementor-widget elementor-widget-text-editor\" data-id=\"bde13b9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>WITH_EDITORONLY_DATA instructs unreal engine to compile and store this data only for Editor environments. That is, this data\/variables will be stripped out and will not exist in shipping builds.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-56545e7 elementor-widget elementor-widget-heading\" data-id=\"56545e7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">2. Create a Child Class From UFactory<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6a76c70 elementor-widget elementor-widget-text-editor\" data-id=\"6a76c70\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p><a href=\"https:\/\/docs.unrealengine.com\/4.27\/en-US\/API\/Editor\/UnrealEd\/Factories\/UFactory\/\" target=\"_blank\" rel=\"noopener\">UFactory<\/a> is the class responsible for reading and creating files. It&#8217;s a UAsset creator or file creator. Hence the name; Factory. A factory makes \/ manufactures things and that&#8217;s what the UFactory class is for.<\/p><p>We create a new class that inherits from UFactory and then override a few functions. FactoryCreateFile() is the function you want.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-db0d41c elementor-widget elementor-widget-code-highlight\" data-id=\"db0d41c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard word-wrap\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>virtual UObject* FactoryCreateFile(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename, const TCHAR* Parms, FFeedbackContext* Warn, bool& bOutOperationCanceled) override;<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-99f3b65 elementor-widget elementor-widget-text-editor\" data-id=\"99f3b65\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>One other critical step is instructing the unreal editor to read in the new file extension. We do this in the Constructor or our UFactory child class and the way to do it is to call the<br \/><strong>Formats-&gt;Add(&#8220;extension;description&#8221;) <\/strong>function. <strong>Formats<\/strong> is a variable inherited from Ufactory. Example:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dae9ff3 elementor-widget elementor-widget-text-editor\" data-id=\"dae9ff3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Lets say we want to read and import files with &#8220;.bcg&#8221; file extension. This is how you instruct unreal engine to support the .bcg file.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7b9be07 elementor-widget elementor-widget-code-highlight\" data-id=\"7b9be07\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard word-wrap\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>UBcgAssetFactory::UBcgAssetFactory()\r\n{\r\n\tFormats.Add(\"bcg;BCG File\");\r\n\tSupportedClass = UBcgAsset::StaticClass();\r\n\tbCreateNew = false;\r\n\tbEditorImport = true;\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-267feb0 elementor-widget elementor-widget-text-editor\" data-id=\"267feb0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Once we read the file, SupportedClass is the class we&#8217;d like to create an object from. Remember, this is a minified tutorial. The best way to learn this is by taking our plugin development course. Videos are the best way to cover this topic and that&#8217;s where we cover everything from A-Z.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9c41558 elementor-widget elementor-widget-heading\" data-id=\"9c41558\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">3. Return a UObject inside FactoryCreateFile()<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e902f0a elementor-widget elementor-widget-text-editor\" data-id=\"e902f0a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Inside the implementation of the FactoryCreateFile() override, you need to do one <strong>critical<\/strong> thing:<\/p><p>\u00a0<\/p><p>You need to create a UObject (or child class of UObject) and return this UObject. This is where the class we created in step 1 comes in. You need to create the object with NewObject and then modify the object before returning it.<\/p><p>\u00a0<\/p><p>In our case, modifying the object means we read data from our new file extension and then convert and store that data into our UBcgAsset child class object and then we return this object.<\/p><p>\u00a0<\/p><p>You should be able to select BCG files when you use the import button in the editor and unreal engine will do the rest. Your asset should appear in the editor shortly after.<\/p><p>\u00a0<\/p><p>You do not need to worry about instantiating this UFactory as unreal engine will automatically scan and instantiate all UFactory child classes.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fd858d1 elementor-widget elementor-widget-heading\" data-id=\"fd858d1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Conclusion<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9be4b51 elementor-widget elementor-widget-text-editor\" data-id=\"9be4b51\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>These 3 main steps are the critical steps needed to create a new asset in unreal engine. If you want to create the new UAsset\u00a0 from right-click, you just need to set bCreateNew=true;\u00a0<br \/>We highly recommend looking at other plugin source files or taking our unreal engine plugin development course. Whichever you&#8217;re comfortable with. This tutorial is around 60% of the explanation but you at least have an idea of the path to follow and the critical classes needed to accomplish the task of creating custom assets in unreal engine.<\/p><p>You can always contact us by email for free support and let us know how we are doing.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"featured_media":0,"template":"","asx-lms-tutorial-categories":[55,58,45],"asx-lms-tutorial-tags":[46],"class_list":["post-3450","asx-lms-tutorial-cpt","type-asx-lms-tutorial-cpt","status-publish","hentry","asx-lms-tutorial-categories-plugin-development","asx-lms-tutorial-categories-unreal-c-api","asx-lms-tutorial-categories-unreal-engine","asx-lms-tutorial-tags-cpp","entry"],"acf":[],"_links":{"self":[{"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-cpt\/3450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-cpt"}],"about":[{"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/types\/asx-lms-tutorial-cpt"}],"version-history":[{"count":0,"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-cpt\/3450\/revisions"}],"wp:attachment":[{"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/media?parent=3450"}],"wp:term":[{"taxonomy":"asx-lms-tutorial-categories","embeddable":true,"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-categories?post=3450"},{"taxonomy":"asx-lms-tutorial-tags","embeddable":true,"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-tags?post=3450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}