C++ Class Wizard

An overview of the C++ Class Wizard in Unreal Engine.

Choose your operating system:

Windows

macOS

Linux

The C++ Class Wizard provides a fast and easy way to add native C++ code classes into your project for you to extend with your own functionality, if you wish. This converts a content-only project into a code project. You can access the C++ Class Wizard and create a new C++ class by following these steps:

Check Setting Up Visual Studio to ensure that you have a compatible version of Visual Studio installed before proceeding. For information about the correct version of Xcode, refer to the

[Unreal Engine Release Notes](what-is-new\unreal-engine-5-1-release-notes)
.

  1. In the main editor, select Tools > New C++ Class...

    Open a new CPP class from the menu bar.

  2. The C++ Class Wizard will appear and show Common Classes by default. If you do not see the class you are looking for, you can view the entire Class hierarchy listing by selecting All Classes.

    Common Classes

    All Classes

  3. Choose the Class you want to add. For the purposes of this demonstration, we will choose to create a new Actor Class. Select the Actor Class, then click Next >.

  4. You will then be prompted to enter a Name for your new Class. Do so, then click Create Class. This will create the header (.h) and source (.cpp) files.

    Class names can only contain alphanumeric characters and cannot contain spaces. The field will notify you if you enter an invalid name.

  5. In Unreal Engine, Live Coding is now enabled by default. A Live Coding window will appear and compile the new class files that were created.

  6. The code will immediately open in Visual Studio, ready for editing.

    code-in-vs.png

    The code will immediately open in Xcode, ready for editing.

    CodeEditing_xcode.png

For instructions on compiling your Class when finished editing, please see the Compiling Projects documentation.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel