Creating Player Character

This page documents the steps to creating a character for LIMEN

Overview

Characters in LIMEN are abstracted from the _Player prefab. They can be swapped in and out under the AnimatedBody structure, and are referenced by their index within the _GlobalContainer array.

Character Structure
Character Page

Creating the Character Prefab

  1. Import mesh: rename .fbx to character name, limit max texture sizes for optimization, import animation as humanoid, and generate an avatar

  2. Character mesh object should have no transformations and uniform (1, 1, 1) scale, and the "root" bone should have uniform scaling, no translation, and only 90-degree rotations are allowed to change facing direction if the rig was in a different coordinate system

  3. Add Character.cs script to an empty GameObject, this will be the Character object and meshes and bones will go as children

  4. Fill in mName for the character, and change the GameObject name to "Character - NAME"

  5. Don't forget to make this a prefab!

  6. Add to _GlobalContainer character array.

Equipment Attachment Point & IK

Offset is where slight position adjustments and rotation adjustment go

All equipment hand positions are recorded using the Base/Starter character. The actual (Transform) Hand Equipment Attachment has no transformations. Thus, the Hand Retarget Offset is used to integrate the starter character recordings into the new character.

Creating Hand Attachment

  1. Create (Transform) Hand Equipment Attachment GameObject that has no transformation and uniform (1, 1, 1) scale

  2. Create Hand Retarget Offset GameObject, set it as the parent of the Hand Equipment Attachment object

  3. Apply 90-degree rotations to an axis until the local view shows orientation like the image below, with green pointing out along the arm, blue as up right-handed coordinate (thumb-up), and red pointing inward towards the body

  4. Assign (Transform) Hand Equipment Attachment to mHandEquipmentAttachment field

  5. Create Shoulder Mount (Transform) as a child of the upper-arm bone, assign to mShoulderMount field

  6. Assign head bone to mHead field

Coordinate orientation forHand Retarget Offset
Shoulder mount
Shoulder mount hierarchy

Tuning Attachments

Now that there are references, the game can run but equipment may not be held perfectly in hand yet

  1. Play game as this character, and switch to an equipment easy to reference such as Phone

  2. Adjust position of the Hand Retarget Offset till it looks correct, save to the prefab

  3. Equip flashlight and adjust position of shoulder mount till looking correct, save to the prefab

  4. Disable FSMCaller under AnimatedBody, equip Tablet then move/rotate Hand Target until tablet looks good in hand, copy local position into mTabletHandIKTargetPosition field.

Ragdoll Setup

Use Unity's Ragdoll setup wizard in Create->3D->Ragdoll and just fill in the bones, click generate and you are good to go!

Character Name Localization

Add an entry in Lean with the name being the name of the character and fill in the translations.

Last updated