With your project open, select the character in the level and press Delete to remove it.
This is the default Character Blueprint that comes with this template. Notice that it has a Camera component attached to it already and you can see a preview window of the perspective that will be used when playing as this character. We are going to recreate this setup from scratch on a new type of playable character.
In the Content Browser, click the Add New button then select Blueprint Class from the menu.
In the Pick Parent Class window, select Character then name the Blueprint MyCharacter.
After you choose a save location and a name for the new Blueprint, the Blueprint Editor Interface will open automatically.
In the Components window select the CapsuleComponent then in the Details panel, change the Capsule Half Height to 64.
The Capsule Component is used to provide Collision Detection for the character.
In the Components window, click the Add Component button and search for and add a Static Mesh component.
In the Details panel for the Static Mesh, set its Z location to -60 and assign the Shape_NarrowCapsule as the Static Mesh.
By adjusting the Z value for the capsule location, you will see that the Static Mesh drops down inside of our CapsuleComponent.
In the Components window, click the Add Component button and search for and add a Camera component.
This is the camera that will be tied to this character providing us with a third person perspective. While this example has us focusing on a playable character, you can add a Camera component to any Blueprint, for instance you could create a security camera that produces a view for a player to look through.
In the Details panel for the Camera, set its location for X to -120 and it�s Z to 20.
We've used these values to position the camera behind the capsule, however you can adjust the position as you see fit.
Click the Add Component button again and search for and add an Arrow component.
Not only are we going to allow this character to use a third person perspective, but we are going to allow the player press a button and move the camera to an over-the-shoulder type view. We will use this Arrow component to tell the camera where to move when the button is pressed or released.
In the Details panel for the Arrow component, set its location the same as Step 8.
This is a reference to the default camera location that we will want to return to once the button is released.
Click the Add Component button and add another Arrow component, set its Location as shown below.
We've set the X to -40 and the Y to 40 to produce the example below.
You can adjust the position of the Arrow components as you would like.
Click the Event Graph tab, then Right-click in the graph and search for and add a Right Mouse Button Event.
The Event Graph is where will provide the scripted functionality to move the camera.
In the My Blueprint window, hold Ctrl and Left-click and drag the Camera component into the graph.
This will allow us to set properties or affect the camera component as we are getting a reference to it above.
In the My Blueprint window, Ctrl-Left-click and drag in both Arrow components.
In the graph, Left-click and drag off the out pin of the Camera node and search for and add a SetRelativeLocation node.
This will allow us to move the camera to the desired location.
Drag off Arrow 2 and search for and add the Get Relative Location node, then connect the nodes as shown below.
When the Right Mouse Button is pressed, we Set Relative Location of the camera to the Relative Location of the Arrow 2 component (which is our over-the-shoulder camera position). Next we need to set the camera back to its default location (which is the position of Arrow 1) when the Right Mouse Button is released.
Copy/Paste the SetRelativeLocation and repeat the previous step for Arrow 1 as shown below.
Our script is complete and we can now toggle between the two camera locations when the Right Mouse Button is pressed/released.
Click Compile from the toolbar, Save and close the Blueprint.
Our character is setup, however we still need to tell our project that the character we created should be the default character to use when playing the game. We can do that from the Level World Settings by changing the settings in the Game Mode that is being used with this template.
From the main Level Editor window, click the Settings button from the toolbar and select World Settings.
In the World Settings window, under Selected GameMode, click the Default Pawn Class and change it to MyCharacter.
From the main toolbar, click the Play button to play in the editor.