Empty project - why a camera and movement?

Sorry, can’t see the forest for the trees…:

If I create an empty (Basic) C++ project and hit Alt-P, I have a camera and can move around using WASD. The question is - why? There is no input mapping defined under Project Settings, and the generated C++ code is empty. So where does this behavior actually come from?

I would assume it simply inherits the functionality from AActor, but I’m not sure. The empty project certainly is not empty though, as it contains the UE4 API at your disposal.

Or, now thinking about it, back in the UE3 days, we had to change the game mode with an .ini file, so the functionality for the camera might be from a defaultgame.ini.

No, the ini files don’t contain that information. The DefaultInput.ini has mappings for a gamepad (which then shows up under the project settings), but I think you have to specifically add key mappings to make it work with the keyboard.

What confuses me is that the third-person C++ template specifically adds keyboard mappings and camera components in the character class. If I remove e.g. the MoveForward mapping from the project settings the W and S keys no longer work, so this code really is executed. So there must be

  1. a place where I tell UE4 to use my character instead of some default implementation
  2. a default implementation with a camera and keyboard mappings that is used if i don’t define my own (?)

So they no longer have game mode and such in ini files? That’s good. Where is it grabbing the default game mode from though?

It’s ADefaultPawn

It’s being spawn via engine code alone via default configuration, no need for your code to make it work. I think you can also see it in Outliner tab

Dude, nice. I swear, how do you guys find things like that? How would I ever know that ADefaultPawn is the default class called for player mode?

1 Like