No announcement yet.

Guide: Custom Character with Custom Animation

  • Filter
  • Time
  • Show
Clear All
new posts

    Guide: Custom Character with Custom Animation

    This is pretty much a complete tutorial on how to import your custom character and animations into the UDK.
    I created this tutorial because I had some trouble getting my character into the UDK myself and I had to browse so many forums.

    Please feel free to correct me on stuff if I'm wrong or add important things.

    I will try to explain the following steps:
    1. Import into UDK
    2. Creating Sockets
    3. Creating a Basic AnimTree
    4. Making UDK recognize your stuff
    5. Animations for Melee Attacks

    I assume you know how to export a character and animations otherwise take a look here:

    -Your Rig/Skeleton needs a rootjoint placed at (0,0,0) at top of your hierarchy
    -ActorX only exports Meshes and Bones, so clean up your scene before you export either by baking your animation to your bindjoints and deleting all stuff you don't need anymore or by placing the suffix _noexport (for single bone) or _ignore (for a hierarchy) for ALL joints you DON'T want to export
    NO groups in your bindjoints hierarchy, this will mess up your animations in UDK
    -In the ActorX options (axoptions in MEL) uncheck the "bake smoothing groups" option, smoothing groups will split your mesh and increase the vertex count.

    1. Import into UDK

    Ok, the first step should be pretty easy.
    Click on import, choose your Character.PSK file and open it.
    The Importer has an options for Maya Coordinates. You can use this, but I recommend to rotate your character by 90, 0, 90 before you export.
    Your Character has to face the positive X-Axis and the Z-Axis should be the Up-Axis.
    If you forgot to do this, you can use the “Rot Origin” (rotate origin) inside the AnimSet-Viewer.

    Now right-click in the Content Browser and choose New AnimSet.
    After creating your AnimSet open it.
    Choose File -> Import PSA and open your Animations.PSA

    In the Browser Tab under Skeletal Mesh select your Character.
    You should be able to play your animations now.
    In the Properties Tab click on AnimSet and check the option "Anim Rotations Only?"
    Click on "Use Translation Bones" and create at least 2 Translation Bones.
    The first one should be your rootbone and the next one your pelvis/hip bone.
    You have to create Translation Bones for every bone that should take translation from your animations.
    It should look something like this:

    You don't need to do this, your Character will still be able to move/jump but it will NOT play any animations like Taunts or Melee Attacks.

    This completes Part 1 of the tutorial.

    2. Creating Sockets

    In the AnimSet Editor click on Mesh and choose Socket Manager.

    Click on New Socket
    Choose your right-hand-weapon-bone click OK, enter WeaponPoint as socket name and click OK again.
    Click on New Socket again, choose your left-hand-weapon-bone click OK and enter DualWeaponPoint as socket name, click OK again.
    Click on New Socket, choose your right-ankle-bone, enter R_JB as socket name.
    Do the same for your left-ankle-bone.
    Click on New Socket again, choose your neck or head bone and enter HeadShotGoreSocket.

    You can close the AnimSet Editor now. (Time to save your work)

    This completes Part 2 of the tutorial.

    3. Creating a Basic AnimTree
    (For reference take a look at the AT_CH_Human AnimTree)

    Right-Click in the Content Browser and choose New AnimTree.

    You need to tell Unreal when and how it should play your animations.
    So open your AnimTree by double-clicking on it.

    The first Node you need is a AnimNodeBlendByPhysics. This Node contains pretty much every situation your character can be in.

    Connect the Out Option of your AnimNodeBlendByPhysics with the Animation Option of your AnimTree.
    Now Create a UTAnimBlendByIdle Node and connect the Out Option with the Walking Option of the AnimNodeBlendByPhysics Node.

    Create a UTAnimNodeSequence and enter the name of your idle animation as Anim Seq Name in the properties tab.

    Connect it to the Idle option of the UTAnimBlendByIdle Node.

    Create a AnimNodeBlendDirectional Node and 4 UTAnimNodeSequence Nodes.
    Enter the names of your forward run, backward run and strafe animations and connect the Nodes to the right slot.

    Create a UTAnimBlendByFall Node and 8 UTAnimNodeSequence Nodes.
    This is where you define your jump animations or the animations that should be played when the character is in the air.
    If you don't have all the necessary animations you have to improvise or just export parts of your jump animations for this.

    Connect the UTAnimNodeSequence Nodes to the UTAnimBlendByFall Node.

    Your character should now be able to move and jump.

    This completes part 3 of the tutorial.

    4. Making UDK recognize your stuff
    NOTE: I know you shouldn't change the original files and always create your own ones. But this isn't part of this tutorial and for testing purposes only.

    Now we have to change some of the .uc files in [your UDK folder]/Development/Src/UTGame/classes.
    I recommend to make a back-up of the files.

    Open the UTPawn.uc file.
    Scroll down to defaultproperties and find the line
    AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_ Human'
    and change it to
    AnimTreeTemplate=AnimTree'YourPackage.YourGroup.Yo urAnimTree'
    This is where we tell Unreal which AnimationTree the Playercharacter should use.

    Now open the UTFamilyInfo_Liandri_Male.uc file
    Scroll down to defaultproperties and find the line
    CharacterMesh=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK _CH_LIAM_Cathode'
    and change it to
    CharacterMesh=SkeletalMesh'YourPackage.YourGroup.Y ourCharacter'
    In the same file find the line
    AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _BaseMale'
    and change it to
    AnimSets(0)=AnimSet'YourPackage.YourGroup.YourAnim Set'
    This is where we tell Unreal which character to show and which AnimSet to use.

    If your character doesn't show up and Unreal shows the default character with no animations then you have to open the UTFamilyInfo_Liandri.uc file and do the same things as in UTFamilyInfo_Liandri_Male.uc

    This completes part 4 of the tutorial

    5. Animations for Melee Attacks
    This is actually pretty easy.

    Open the UTFamilyInfo.uc file and add some FamilyEmotes as EmoteAnim enter the name of your Melee Attack animations.

    Open a UTWeapon_XXXXX.uc file the LinkGun would be pretty handy since it is the default weapon
    find the line
    and add below this line
    UTPawn(Instigator).PlayEmote('(The name of the EmoteTag that should be played)', -1);
    Now your character should be playing the Melee Attack animation when you press fire.

    This completes part 5 of the tutorial.

    Thanks for doing this Fishi, now I don't have to.


      mean thanks a lotttttt


        Thanks! The melee tutorial helps a lot! I'll try it.


          You're welcome guys.
          I know it's a pain in the *** to figure all this stuff out.
          I was looking for a tutorial on this myself, when I was doing this for our School Project, but couldn't find one

          btw, Denny, you're not by chance Denny Lindberg from StarVault?
          If you are, I love your game


            Yes I am.


              Thank you very freaking much!
              I have a quite inspiration but I just can't figure some things out, this tutorial surely helps me alot!
              Great job! =)


                you can try the AnimNodeRandom and add some Inputs, one of your sequences will be chosen and played.
                Right-Click on the Node and select Add Input.

                if you press the spacebar while a node is selected, this node will be played in your preview window.
                and if you enable the options Playing? and Looping? in your sequences you get a nice result in your preview window.


                  I tried this tutorial, but when I try to run, UDK crashes on me. I followed everything. Something I'm missing?


                    Nevemind. Got it working but having more issues.


                      Can we see any result?
                      Thanks for the tutorial.


                        I will make a video next week, too much stuff on my hands right now.


                          Originally posted by Hendrixlt View Post
                          Nevemind. Got it working but having more issues.
                          The issue I'm having right now is that my character is in the engine, the animations work, and it's doing what we tell it to do. However, the model is levitating about a half inch off the ground when I move.

                          Is this a physics issue, or something to do with the animtree?


                            Any reason it crashes for me...? im exporting from blender, it crashes when importing the .psk file... using the feb beta


                              This tutorial is fantastic, I have a much simpler request before delving into this though - How do you setup the bones in Maya to do a quick and dirty mesh replacement? I have a model and I just want to use the K_AnimHuman_BaseMale animation files for now.