2.1 - Making a New Character

Learn how to make a new character for your First Person Shooter project.


During this step, we're going to make a new character using the engine's Character base class. The Character class (derived from the Pawn class) has built-in functionality for bipedal movement; such as walking, running, and jumping.

Adding a Character Class

Although you can manually add *.h and *.cpp files to your Visual Studio solution, it's good practice to use the C++ Class Wizard to add new classes to your project. By using the C++ Class Wizard, the engine creates header and source templates that set-up Unreal specific macros for you.

  1. In the File menu, select New C++ Class... to choose your new parent class.


  2. The Choose Parent Class menu will open. Scroll down, select Character as the parent class and click Next.


  3. Name the new class "FPSCharacter," then click Create.


    Now that you've created your FPSCharacter class, you can switch to Visual Studio to add code to your newly created class. FPSCharacter.h and FPSCharacter.cpp will be opened for you and Unreal Engine will automatically compile and reload the code for your new class.

Verifying the Character Class

  1. In the Solution Explorer, expand FPSProject > Source > FPSProject.


  2. Double-click FPSCharacter.cpp to open the implementation file for your FPSCharacter class.

  3. Add the following lines of code in the BeginPlay() function to verify that FPSCharacter class is being used:

    if (GEngine)
        // Put up a debug message for five seconds. The -1 "Key" value (first argument) indicates that we will never need to update or refresh this message.
        GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("We are using FPSCharacter."));
  4. FPSCharacter.cpp should now look like the following:

    // Fill out your copyright notice in the Description page of Project Settings.
    #include "FPSProject.h"
    #include "FPSCharacter.h"
    // Sets default values
        // Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
        PrimaryActorTick.bCanEverTick = true;
    // Called when the game starts or when spawned
    void AFPSCharacter::BeginPlay()
        if (GEngine)
            // Put up a debug message for five seconds. The -1 "Key" value (first argument) indicates that we will never need to update or refresh this message.
            GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("We are using FPSCharacter."));
    // Called every frame
    void AFPSCharacter::Tick( float DeltaTime )
        Super::Tick( DeltaTime );
    // Called to bind functionality to input
    void AFPSCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
  5. Save the FPSCharacter CPP file in Visual Studio.

  6. Locate FPSProject in the Solution Explorer.

  7. Up until now, you've been compiling your project using the editor's Build button. During this step, you're going to gain experience compiling code using Visual Studio's build feature. To compile your code from inside Visual Studio, right-click on FPSProject and select Build to compile your project.


  8. After the build finishes, open Unreal Editor to verify that your newly compiled FPSCharacter class is visible in the Content Browser.


Extending your CPP FPS Character Class to Blueprints

Now is a good time to extend the CPP FPS Character class to Blueprints. Please feel free to go to our C++ and Blueprints reference page to learn more about extending C++ classes to Blueprints.

  1. Right-click the FPSCharacter class to open the C++ Class Actions menu.


  2. Click Create Blueprint class based on FPSCharacter to open the Add Blueprint Class dialog menu.


  3. Name your new Blueprint Class "BP_FPSCharacter" and choose the Blueprints folder before clicking the Create Blueprint Class button.


  4. By now, you should have a newly created BP_FPSCharacter Blueprint Class located inside of the Blueprints folder.


  5. Make sure to save your BP_FPSCharacter Blueprint before closing the Blueprint Editor.

Setting the Default Pawn Class

Now that we've successfully extended our newly modified Game Mode to Blueprints, we'll need to set our project to use BP_FPSCharacter as the default Pawn in this step.

  1. In the Edit menu, click on Project Settings.

  2. Under the Project heading on the left side of the Project Settings tab, click on Maps & Modes.

  3. Select BP_FPSCharacter in the Default Pawn dropdown menu.


  4. Close the Project Settings menu.

  5. Click the Play button in the Level Editor Toolbar. "We are using FPSCharacter." should now be displayed in red text below "Hello World, this is FPSGameMode!" for five seconds in the upper left corner of the viewport.


    If you're unable to move, you're using FPSCharacter as your Pawn correctly! Your new Character doesn't have any movement controls yet, so you won't be able to move around in the level.

  6. Before going to the next step, press the Escape key or click the Stop button in the Level Editor to exit Play in Editor (PIE) mode.

Select Skin

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback