Unreal Cheatsheet
Classes
Actor: base class for classes present in scene. Lifetime: level.
ActorComponent: base class for components attached to Actors. Lifetime: level.
CheatManager: class for gameplay debugging functionalities, cheats. Instanciated in Debug and Development builds. Referenced by Controller. Lifetime: level.
DataAsset: base class for anything managed by the asset manager that isn’t a Blueprint.
GameInstance: class persistent across levels. Single instance throughout the whole runtime of the application. Lifetime: runtime.
Controller: class receiving user inputs and containing pawn controlling logic. Consumes inputs by default. Set the default one in your GameModeBase deriving class. Not replicated for networking. References CheatManager. Transform not attached to Pawn by default. Lifetime: level.
Pawn: class “posessed” by a controller. Set the default one in your GameModeBase deriving class. Lifetime: level.
PlayerCameraManager: class for overriding default camera behaviour (non springarm + camera setup). Associated with a Controller. Lifetime: level.
HUD: don’t. Use UMG instead.
GameMode: don’t. Use GameModeBase instead.
GameModeBase: class defining what managers to use. Only one is used at a time. Set up the default one in project settings. Does not receive inputs. Lifetime: level.
GameState: class for managing state of the world but NOT specific to any player. Keep things like time of day in there. Lifetime: level.
PlayerState: class for holding player specific state. Use it for multiplayer projects since Controllers aren’t replicated over the network. Lifetime: level.
Blueprint Facilities
- Interface: Function declarations only. Functions can be declared const but not pure. Allows for breaking hard references. Can’t contain event dispatchers and functions can’t have delegates as arguments.
- Function: Ordinary function. Can’t call asynchronous nodes. Can’t have multiple execution outputs. Can return values. Can’t use delegate arguments nor return values.
- Custom events: Public function that cannot return anything but is allowed to execute asynchronous nodes.
- Event dispatchers: Variables you can bind other events or functions to. Doing so requires creating a hard reference.
- Set: array of unique elements.
- Map: key-value pairs, one value per key.
User Input Processing Stack
- PlayerControllers
- Pawns Check “Block Input” to consume input on the InputComponent. Note “Consume Input” refers to consumption of Event arguments, not user inputs.
Initialization / Destruction Order
-
GameInstance: Init
-
CheatManager: InitCheatManager
- Pawn: Possessed
-
PlayerController: OnPossess
- GameModeBase: BeginPlay
- LevelBlueprint: BeginPlay
- GameState: BeginPlay
- PlayerController: BeginPlay
- PlayerState: BeginPlay
- PlayerCameraManager: BeginPlay
-
Pawn: BeginPlay
-
Game runs…
- Pawn: Unpossessed
-
PlayerController: OnUnPossess
- PlayerCameraManager: EndPlay
- PlayerState: EndPlay
- PlayerController: EndPlay
- GameModeBase: EndPlay
- LevelBlueprint: EndPlay
- GameState: EndPlay
-
Pawn: EndPlay
- GameInstance: Shutdown
2 though 21 is called for every level. 1 and 22 is only called once per runtime. Note: Shutdown is never called on CheatManager for god knows what reason.