We're now going to create a new C++ class with the following steps:
- To do this, from the Unreal editor, click on File | New C++ Class. We'll be creating an Actor class, so select Actor as the base class. Actors are the objects that are placed in the scene (anything from meshes, to lights, to sounds, and more).
- Next, enter a name for your new class, such as
MyNewActor. Hit Create Class. After it adds the files to the project, open
MyNewActor.h in Visual Studio. When you create a new class using this interface, it will generate both a header file and a source file for your class.
- Let's just make our actor print a message to the output log when we start our game. To do this, we'll use the
BeginPlay is called ...