How to create a plugin in Unreal Engine 4

Nov, 12 2020— #basic

In order to create a plugin, you need to follow a few simple steps.

  1. Open a game project
  2. Click "Settings" -> "Plugins" -> "New plugin"
  3. Select a plugin template, enter a name and click "Create plugin"
  Settings -> Plugins

  Settings -> Plugins

After completing the plugin creation process, you can notice a plugin folder in your game directory: "Plugins/[PluginName]". This will contain all the files associated with the plugin.

You will also have an opened Visual Studio and there will be some extra folders and files:

You will see similar files and folders

You will see similar files and folders

In the file "[PluginName].Build.cs" you can write anything related to the process of building the plugin source code. If you want to know some of the commands, it's recommended to visit the official documentation related to it - UnrealBuildTool.

There are declaration and definition files ("[PluginName].h" and "[PluginName].cpp"), where you can write any C++ code related to the plugin.

In order to include the plugin to your project and call methods or functions outside the plugin inside C++ classes, you should include plugin's header file and add this in the project file "[ProjectName].Build.cs":

PrivateDependencyModuleNames.AddRange(new string[] { "PluginName" });
By Georgy Treshchev

Unreal Engine Developer. Contact for any questions. Telegram chat, e-mail, Github.