Creating Blueprint
Last updated
Last updated
You can Copy one of the Templates and replace the character with your character's skeletal mesh, or you can skip and go to Setting up the Chooser. Right-Click in your Character Folder and Select Blueprint Class. Select Character I named mine BP_CC4 Re-Parent it from Class Settings to CBP_SandboxCharacter_DAO Select Add under the Components Window on the left hand side and if your skeletal mesh is selected in the content draw it will show 'Skeletal Mesh (Your Skeletal Mesh Name)' in my case this was Steve. Drag and Drop your Skeletal Mesh under the Mesh (CharacterMesh0). Zero out the Location and Rotation. Assign your Skeletal Mesh the ABP_DAO_GenericRetarget to it's Anim Class. Assign your IK Retargeter to the IKRetargeter Variable in the Class Defaults DAO->Defaults->CharSpecific->IKRetargeter In the Hand Socket Names Map, you will see the default names for the Sockets. You should create these sockets on each hand of your character. Go to Edit->Project Settings Go To GameplayTags and Manage Gameplay Tags Somewhere in here create a GameplayTag for Identifying this Character's Body Type. Set that tag as your Char Tag, this will allow us to lookup the Character Data from the Item Choosers that way we can load the Correct IK Chain Settings for your Character when required. Under My Blueprint, expand the Override menu and search for GetCharacterMesh and override it, plug your character's skeleton into the Return Node of this Function. This allows me to attach things to your character instead of the UEFN character. The only other thing you will need to do is call the Set IKRetargeter from the BeginPlay and pass it your character, this tells the system that there is an IK Retargeted Character Setup and that it needs the IK Retargeting Settings Passed to the ABP_DAO_GenericRetarget Anim Instance. The IK Retarget Settings will be stored in the Choosers for each Item where it will look up your character's settings for that item. When those settings are needed, they will be retrieved from that Item. The Item will store a cached version of it until the character holding it changes which means that the Chooser will only need to be ran once.