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.


Creating the Character Prefab
Import mesh: rename
.fbx
to character name, limit max texture sizes for optimization, import animation as humanoid, and generate an avatarCharacter 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
Add
Character.cs
script to an emptyGameObject
, this will be theCharacter
object and meshes and bones will go as childrenFill in
mName
for the character, and change theGameObject
name to "Character - NAME"Don't forget to make this a prefab!
Add to
_GlobalContainer
character array.
All scaling will be done on the Character - NAME GameObject, mesh and bone root should have uniform (1, 1, 1) scaling
Equipment Attachment Point & IK


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
Create (Transform) Hand Equipment Attachment GameObject that has no transformation and uniform
(1, 1, 1)
scaleCreate Hand Retarget Offset GameObject, set it as the parent of the
Hand Equipment Attachment
objectApply 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
Assign (Transform) Hand Equipment Attachment to
mHandEquipmentAttachment
fieldCreate Shoulder Mount (Transform) as a child of the upper-arm bone, assign to
mShoulderMount
fieldAssign head bone to
mHead
field

Hand Retarget Offset


Tuning Attachments
Now that there are references, the game can run but equipment may not be held perfectly in hand yet
Play game as this character, and switch to an equipment easy to reference such as
Phone
Adjust position of the Hand Retarget Offset till it looks correct, save to the prefab
Equip flashlight and adjust position of shoulder mount till looking correct, save to the prefab
Disable
FSMCaller
under AnimatedBody, equip Tablet then move/rotate Hand Target until tablet looks good in hand, copy local position intomTabletHandIKTargetPosition
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.
Verify your setup. If everything is done correctly, the character inspector will show a green Setup:Passed; if not, it will show errors in red.
Last updated