Coming from Unity- Pawns and Controllers.

Before using UE4 I had been using Unity for about a year. We had finally decided on a game, setting, gameplay, controls, and flow when we stumbled across a show-stopping bug. So many of my future posts will be written with Unity in mind.

Unity is based around gameobjects. Everything in the world is a gameobject; these gameobjects have attached scripts which are executed in a fixed order. They also possess a transform which is their position in the world. One possible setup for a player character could be a gameobject with a renderer, a model, a transform, a collision mesh, and various control scripts. In our case we had one script to control input, one to handle player states / health / current equipment, one to handle slow motion, and so on. The camera was a separate gameobject that had its own script to follow the player.

UE4 operates on a different system, the Pawn Controller system. In this you have Pawn blueprints, which operate similarly to gameobjects. They have a position, model and collision mesh (much like in Unity); however they can also have a camera.

The Controller blueprints work a little differently; they also have a position and facing, but they “possess” a Pawn. Possession means that the controller takes control of the camera attached to the Pawn. It also passes input to the Pawn which the pawn then turns into movement/actions.

So what does all this mean? You can have several pawns lying around, doing nothing, until you set a character controller to possess one. The camera attached to that pawn will be used, it will start receiving input and you are good to go. At any time you can move your player controller to another pawn, which will change your camera, send that pawn input and so on. This is a neat way of implementing a change in control scheme and camera when your character gets into a car, for example. It also helps in multiplayer games, where you don’t need to spawn multiple cameras as they are attached to the pawns, and each controller can take input from different sources, but the code in the pawn can be the same.

There are extensions of this in the AIController, which I’ll talk about later.

What I am doing here.

Hello all, My handle is Antinumeric and I’m planning on making a game with a friend of mine- Tiny Angry Crab. After much deliberations and several false starts we have settled on the UE4 engine to build our game in. However having no experience with UE4 there is a great deal to know first and precious little documentation. So this step can be a little tricky.

I’ve found that I learn best when I work out how to do something and then explain it to someone else, so this blog serves as a platform to do so. In the following posts I shall be uploading tutorials I’ve written describing how to do things such as – set up the main character, how the actor controller system works, how the AI trees work, movement, blueprints and almost certainly more.

I’m doing this for myself but hopefully it’ll be helpful to anyone trying to learn UE4.

-Antinumeric