Visual Studio 2022 v17.11 introduces a new Add Unreal Engine Class dialog that lets you easily add common Unreal Engine classes to your project. You can also choose to which module to add your class, so you can keep your code organized and modular.
To use this feature, you need to have an Unreal Engine project open in Visual Studio. Right click on the project in Solution Explorer and select Add > Unreal Engine Item. In the Add New Item dialog, select Unreal Engine Common Classes to open the Add Unreal Engine Class dialog. This dialog shows you a list of common Unreal Engine classes that you can use as a base for your new class. Once you select a base class, you can enter the name of your new class. You can also specify the module to which Visual Studio should add your class.
When you click OK, Visual Studio will generate the header and source files for your new class and add them to your project. You can then open the files and start writing your code.
Benefits of using the Add Unreal Engine Class dialog
The Add Unreal Engine Class dialog has several benefits over the previous way of adding Unreal Engine classes to your project. Some of the these benefits are:
You can choose from an expanded list of base classes by simply selecting one from the Base class list.
You can specify the module name for your class, which helps you organize your code into logical units. Modules are Unreal Engine plugins or projects that contain related classes and assets. By creating separate modules for your classes, you can improve the modularity, reusability, and maintainability of your code.
You can avoid naming conflicts and errors when adding classes to your project. The Add Unreal Engine Class dialog checks the validity of your class name and path and warns you if they conflict with an existing class or file. It also ensures that your class inherits from the correct base class and includes the necessary headers and macros.
Try it out
We hope you enjoy using the Add Unreal Engine Class dialog in Visual Studio. This feature is part of our ongoing effort to improve the C++ development experience for game developers. We would love to hear your feedback and suggestions on how we can make it even better. Please share your thoughts with us on Developer Community or Twitter.
We also want to thank you for your continuous feedback and support, which helps us make Visual Studio the best tool for developing games with Unreal Engine. Stay tuned for more updates and features coming soon.