♪♪♪
Wes Bunn: Hey everyone, welcome back.
In the previous video, we did Animation Retargeting for our Mixamo character
because it is using a different Skeleton asset than these three (3) characters.
We wanted to take one (1) of the animations these three (3) characters can use
and apply that animation to this character.
However, we couldn't apply the animation directly
because this character is using a different Skeleton asset.
We used Animation Retargeting in the previous video by creating a Rig asset.
The source Skeleton asset passes the information of the Skeleton asset to the Rig.
Then, the Rig passes the information to the new Skeleton asset
so we can retarget the animations. We made a few
more modifications to the Mixamo character's Skeleton asset in between videos.
I believe we mentioned we were going to make some adjustments.
We quickly fixed the hands.
In the Content Browser, open the Mixamo folder and Double-click to open Maw_J_Laygo_Skeleton.
On the Skeleton tab, click the Retarget Manager.
Go down to the Setup Rig section and click Show Advanced.
We assigned the individual fingers, which we didn't do in the previous video.
In the interest of time, we did this in between videos.
If you would like to assign individual fingers for your character, you will need
to retarget the animation again to apply the updates to the hands of your character.
Close Maw_J_Laygo_Skeleton.
This video is focused on sockets.
Sockets are a way to attach something to your character.
For instance, you could put a socket in a character's head to attach a hat.
You could put a socket in the character's hand so they could
be carrying something while they are playing different animations.
We are going to add sockets here.
We are going to work with the source Skeleton asset
so we have a socket that can be used by all three (3) characters.
Let's go ahead and get started.
Go to the Content Browser > ThirdPersonBP > Character > Mesh.
Double-click to open UE4_Mannequin_Skeleton.
Close the Retarget Manager.
Make sure you are on the Skeleton tab.
To add a socket, go to the Skeleton Tree and define where the socket will appear.
We mentioned the head.
In the Skeleton Tree, select the head, Right-click, and select Add Socket.
This will allow us to attach a hat, or something on the character's head.
We could also attach something to the hand. Right-click hand_l, and choose Add Socket.
For our purposes, we are going to add a socket to the character's back
so they could be carrying a sword, or a backpack, etc.
In the Skeleton Tree, select clavicle_l. Right-click clavicle_l, and select Add Socket.
It is asking to input a socket name. Call this socket "back".
It is the back socket.
We can position this socket wherever we would like.
Press W to use the Translation tool.
Move the socket so it isn't in the center of the chest.
Place the socket on the character's back like this.
That should be fine.
Since we are making modifications to the Skeleton Tree, there is an asterisk
next to the Skeleton tab indicating we need to save our Skeleton asset.
Otherwise if we don't save, we will lose this socket.
Click Save.
Close UE4_Mannequin_Skeleton since we have added our socket.
We are going to have to use Blueprints to populate the socket.
This is a bit outside of the scope of this video series.
Typically, you would create a Blueprint of the Character class
so you have the ability to move around, jump, fall, etc.
We are just going to turn the Skeletal Mesh into a Blueprint.
It will be a Skeletal Mesh Blueprint.
Select Trooper_Lead.
This is the character we will start with.
In the Details panel, click Blueprint/Add Script.
It will ask for a name and a save location.
I am going to create the Blueprint with the default information.
UE4 will create the Blueprint for us and open it.
The Skeletal Mesh looks very similar to what was originally inside our level.
Now, we can add things to this Skeletal Mesh.
We can add a sword to this Blueprint that the character can carry.
Before we add a sword, we need to import our sword.
I will undock Trooper_Lead_Blueprint.
Go to ThirdPersonExampleMap.
Let's import our sword.
Right-click in the Content Browser the Content folder, and select New Folder.
Call this folder "Sword".
I am going to go offscreen for a second and bring in the assets folder.
S_Sword_Basic.FBX is the sword we exported from the Couch Knights demo.
We are going to import the sword.
Left-click and drag-and-drop S_Sword_Basic.FBX into the Content Browser.
The FBX Import Options comes up.
We can leave all of the FBX Import Options on the default settings.
Since it is just a Static Mesh, we don't need to worry about any of these options.
Click Import.
We get warnings about smoothing groups and other incorrect information.
It is fine for our example.
I am going to close the dialog window.
Our S_Sword_Basic Static Mesh is in the Content Browser.
The sword is currently using a black material. I am going to change the material.
Double-click to open S_Sword_Basic.
In the Details panel, click the Material drop down menu and type "steel".
Select M_Metal_Burnished_Steel.
It looks pretty good.
Click Save.
Close S_Sword_Basic.
Now, we can add a Static Mesh inside Trooper_Lead_Blueprint.
In the Components tab, click +Add Component.
Type and select "Static Mesh".
Since we have S_Sword_Basic selected in the Content Browser,
the sword will automatically be added to this Blueprint.
In the Components tab, select Static Mesh (S_Sword_Basic).
The sword will be added to this Blueprint.
In the viewport, we can use the Move tool to position the sword on the character's back.
However, even though the sword would follow when the character moves around,
the sword would stay in this location and wouldn't move along with the character's movement.
This is probably not what we would want.
This is where the socket comes into play.
If we put the sword inside the socket,
the sword will follow the socket's translation.
Wherever the socket moves, the sword will move as well.
Let's go ahead and set that up.
In the Details panel with S_Sword_Basic selected, go to the Sockets section.
We can define the Parent Socket.
You can manually enter the Parent Socket name, or you can click
the magnifying glass to assign a bone or a socket.
Select the back socket.
In the viewport, it is going to pop our sword way up into the air
because we adjusted its transform.
In the Details panel under Transform, set X, Y, and Z to 0.
Now, the sword is right in the socket.
However, there are some modifications we will make
so the sword appears correctly on the character's back.
Since our character is moving, it is going to be hard
to position the sword where we want.
In the Components tab, select the SkeletalMeshComponent.
In the Details panel under Animation, uncheck Playing.
It will stop playing the animation for a second.
Click Compile.
Now we can position the sword wherever we want.
In the Components tab, select S_Sword_Basic.
Use the Move tool to move the sword.
Press E to use the Rotate tool and rotate the sword.
Rotate the sword down something like this.
This is the typical position when a character is carrying something on their back.
The backpack built into this Static Mesh is in the way,
but you get the idea.
That looks pretty good.
Let's rotate the sword a little bit more.
That looks pretty good.
In the Components tab, select the SkeletalMeshComponent (Inherited).
In the Details panel under Animation, check the Playing checkbox.
Click Compile. Now the sword moves along with our character, which is better.
Click Save.
Close Trooper_Lead_Blueprint.
Inside the level, you can see the character
we turned into a Blueprint has the sword on their back.
Click Play.
You can see the character is carrying the sword on their back.
These other two (2) characters on the far left are using the same Skeleton asset.
We can populate that socket with whatever we want
because these characters are using
the same Skeleton asset as the source character.
We can put whatever we want inside of that socket.
That was a quick run-down of how you can use sockets
to attach things to your characters and manipulate them.
That is going to be it for this video.
We are going to pause here.
We will pick it back up in the next video where we start talking about
curves and notifies, and how those relate to Skeleton assets.
Thank you all for watching.
We will pick it back up in the next video.
♪♪♪