Add FPP arms and TPP mesh to your Character

In earlier post I’ve described how to move assets from Shooter Game Example. To complete this tutorial you will need to move Animations and Characters folders to your project.

This Tutorial has been created using Unreal Engine 4.8.2. 
Make sure you are working on the same version of the engine.

First of all I’ll write down what I would like to achieve:

  • I want to have animated hands attached to my first person character (which is GameplayPlayerCharacter in this case),
  • Hands should be aiming where I’m aiming and have idle animation,
  • If camera will be outside of my character I will see entire TPP mesh,
  • Character mesh should have idle animation,
  • I want to see my aiming from TPP mesh as well,

Basically I wasn’t able to find a package with animated hands and character mesh. That’s why I will use assets from Shooter Example. You can find separated hands in Unity Asset store.


Fixing assets after importing.

There is a couple of issues after copying assets to our project. Let’s deal with Materials – create new material like this:

M_Playermaterial

Name it M_Player and assign to HeroTPP and HeroFPP meshes. Now we aren’t focusing on graphics side so let’s leave it like it is. Later I will explain how to make this material better.

Let’s move to HeroFPP_AnimationBlueprint and delete every variable and everything from AnimGraph and EventGraph. Do the same with HeroFPP_AnimationBlueprint. They should be clean without any functionality because Shooter Game uses C++ to drive ShooterCharacter which we don’t have here.


GameplayPlayerCharacter adding hands and TPP mesh.

Open GameplayPlayerCharacter and in viewport lets update/add components:

  • Mesh
    – Select TPP mesh and use animation blueprint: HeroTPP_AnimationBlueprint,
    – Location: (X=-0.000002,Y=-0.000001,Z=-86.000000) and Rotation: (Pitch=-0.000000,Yaw=-90.000000,Roll=-0.000000)
    – Set Owner No See to True, (thanks to this if we will be in different camera our TPP mesh will not be visible)
  • Add new component: Camera
    – Set its location to (X=0.000000,Y=0.000038,Z=75.990540)
    – Set Use Pawn Control Rotation to true,
  • Add new Skeletal Mesh component and name it FPPMesh
    – Move FPPMesh to Camera. So it will be attached to the Camera,
    – Select FPPMesh and use animation blueprint: HeroFPP_AnimationBlueprint,
    – Location: (X=-9.983782,Y=8.026691,Z=-145.999725),
    – Rotation: (Pitch=-0.000000,Yaw=-90.000000,Roll=-0.000000)
    – Set Only Owner See to True, (thanks to that only if we are in this pawn’s camera FPP mesh will be visible)
  • Now go to Class Defaults and disable Use Controller Rotation Yaw,

That’s all here. Your components should look like this.

charactercomponents


Now let’s go to HeroFPP_AnimationBlueprint and just add FPP_LauncherIdle to your Animation Pose.

fppanimblueprint

It’s all here. Compile and close.


Now go to HeroTPP_AnimationBlueprint and add two new variables: Pitch and Yaw – both should be float, default 0. Then add this to your Event Graph:

tpp_animeventgraph

Basically we need Pitch and Yaw for our AimOffset. You can read about aim offsets here. Just recreate this animation blueprint:

tpp_animgraph

This is making sure that legs won’t be animated during AimOffset. I’ve used cached pose NormalMovement which can be created by right-click -> New Save Cached Pose. Later on you can right-click and select this cached pose as I did. Another thing is Slot – I’ve used two: UpperBody and FullBody. You can create those by right-click -> Slot’DefaultSlot’ and then just open the magnifier.

addnewslot

At this point if you don’t know how to use animation blueprints you should watch these tutorials made by Epic.


Now let’s test this out! To do so place a camera in your level to be sure that it can see player. (PlayerStart) And in Level Blueprint just add these to toggle camera:

togglecamera

And run the game!

24 thoughts on “Add FPP arms and TPP mesh to your Character

  1. Yeah like Fabrizio, I am missing something… I have the character moved from shooter game, in the char BP it has fpp and tpp and shows fine with material … idle animation. But when running the game, nothing spawns… when I press H i actually see an untextured sphere where the character should be.

    Like

  2. Yeah like Fabrizio, I am missing something… I have the character moved from shooter game, in the char BP it has fpp and tpp and shows fine with material … idle animation. But when running the game, nothing spawns… when I press H i actually see an untextured sphere where the character should be.

    Like

  3. More comments for those are new on UE:

    -These float values when creating the new material? They are called constants.

    -To set permanently the new texture without having to assign it everytime you use it, open directly HeroTPP and HeroFPP. At upper left, where it says LOD0, you can set the texture.

    -Having troubles to set it right the first or third person models? Open GameplayCharacter, and at the Viewport tab, you can see them. The coordinates set by andrzejkoloska doesn’t look good for me, so through here you can see how it is looking.

    -Struggling when trying to get the Cameraactor at the last step? Go read this to know how to get it: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/ReferenceAssets/Blueprints/index.html It will also explain you how to open the Level Blueprint.

    -For last, if you are having problems with something related to the models, reimport them manually.

    Have fun learning :3

    Liked by 1 person

  4. Just follow the instructions to the letter and like me, you will have the desired result :)

    Thank you for this tutorial series, I’m enjoying it a lot. :)

    Like

  5. Pingback: Adding our FPP and TPP … | AcclivityGameStudios

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s