Skip to main content
Version: Next (dev)

Create a C++ Game Plugin

In this tutorial you create a C++ game plugin for the project. Plugins are the recommended way to add native gameplay code because the editor and runtime can load the same code.

Prerequisites

  • You completed Create Your First Scene.
  • Visual Studio and the required C++ workloads are installed.
  • The editor project is open.

Goal

By the end, your project will have a C++ plugin solution that builds successfully and is enabled for the project.

<IMG: Editor dialog for opening or generating a C++ project>

Generate the Plugin Project

  1. In the editor, open the C++ project generation workflow.
  2. Choose the Visual Studio version that matches the engine build you use.
  3. Generate the solution.
  4. Open the generated solution when generation completes.

Build the Plugin

  1. Select the same build configuration that the editor is running, such as Debug, Dev, or Shipping.
  2. Build the solution.
  3. Fix any compiler errors before returning to the editor.

The plugin DLL must be built for the same configuration as the running editor. If the editor runs in Dev, the plugin must also be built in Dev.

Enable the Plugin

  1. Return to the editor.
  2. Open the project plugin settings.
  3. Enable the new game plugin.
  4. Restart or reload the project if the editor asks you to do so.

<IMG: Project plugin settings with the new game plugin enabled>

Verify the Plugin Loads

  1. Run the scene.
  2. Check the output/log panel for plugin load messages or errors.
  3. Stop the scene.

Troubleshooting

  • If the plugin does not appear in the editor, make sure the generated solution built successfully.
  • If loading fails, check that the build configuration matches the editor configuration.
  • If CMake generation fails, revisit the Windows build prerequisites.

Next Step

Continue with Create Your First C++ Component to add behavior from the plugin to a scene object.

See Also