We’re getting started in Unreal Editor now, for part two in the MMO -style controller mini-series. The overview and list of sections is in this post.
Start by creating a new project, use the Third Person Template, in the blueprint section. You could do this in C++, and I will do in the future.
We’ll change some things in the blueprints that you are provided with by default, so we can add the features we want our controller to have.
Note: I created this in project initially in Unreal Engine version 4.6, so if you are using a more recent (or earlier) version things might be a little different.
You’ll need a custom game mode and player controller, created through their default blueprints. I’ve called mine MyGame and MyPlayerController. Very imaginative, right?
Next, make sure these custom blueprints are being used in your World Settings. Set the GameMode Override to MyGame, and then set the default Pawn Class to MyCharacter, and the Player Controller Class should be My PlayerController.
Next we need to set up some axis and input mappings so that we can actually control the character.
Rotate has been added, and the A and D keys have been moved there from the MoveRight axis.
I’ve added StrafeRight. This could have just used MoveRight, but I wanted some distinction from the general MoveRight axis.
I’ve left the Gamepad axis in, although they wont actually do much once we’re finished.
The Action Mappings are next.
Here actions are added for the mouse left and right click, and scroll wheel actions.
Finally we need to change some of the settings in the MyCharacter blueprint. These will break some functionality, but we’ll rebuild this over the course of this mini-series.
In MyCharacter, navigate to the components page, click on the CameraBoom, and find the camera settings. Deselect all of them, like below:
Additionally, the same settings should be deselected in the Pawn options in the Defaults page of MyCharacter.
In MMO games, normally there is a user interface layer, including all your inventories, skills to click, and various other elements to interact with. To that end, we’re going to need to be able to access the mouse. To get our cursor back while we’re playing, these defaults in MyPlayerController need to be changed: