3rd party integration

From UMAWiki
Revision as of 23:25, 12 October 2017 by (talk) (Invector 3rd Person Controller)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here is a collection of tips and tricks for getting other assets to work with UMA.

Invector 3rd Person Controller

To setup the Invector 3rd person controller, you need to be using a version of UMA that has the 'Bone Builder'. This is in Release 2.7 of UMA, but also available as a feature tree for 2.6 on GITHUB.

  • You're going to need an Humanoid Avatar. UMA ships with the FBX models for the human slot sources - but the avatar is set for generic rigging. To fix this, go to the FBX file, and change it the rig type to Humanoid and apply it. For example, the male fbx is here: UMA/Content/UMA_Core/HumanMale/FBX
  • Add an "Animator" component to your DynamicCharacterAvatar.
  • Set the avatar to the Male_Unified avatar (it's the one that was generated when you changed the FBX above).
  • Set the animator to the invector animator of your choice.
  • On the DynamicCharacterAvatar, set the "RuntimeAnimatorController" to the same animator.
  • Run the bone builder on the DynamicCharacterAvatar to create the bones.
  • Open the character creator of your choice from the Invector menu
  • Drop the DynamicCharacterAvatar on the "fbx model" slot
  • Fill in the other two items from the invector files

Press the button on the Invector Character Creator, and you're done! It creates a new gameobject that is ready to go.

Final IK


You need to add the FullBodyIK during runtime. Just hook in to the CharacterCreated callback on your UMA and add the following code:

 1 using RootMotion; // Need to include the RootMotion namespace as well because of the BipedReferences
 2 FullBodyBipedIK ik;
 4 void AddFBBIK (GameObject go, BipedReferences references = null) {
 5     if (references == null) { // Auto-detect the biped definition if we don't have it yet
 6         BipedReferences.AutoDetectReferences(ref references, go.transform, BipedReferences.AutoDetectParams.Default);
 7     }
 8     ik = go.AddComponent<FullBodyBipedIK>(); // Adding the component
 9     ik.SetReferences(references, null);
10     ik.solver.SetLimbOrientations(BipedLimbOrientations.UMA); // The limb orientations definition for UMA skeletons
11 }


You need to add the VRIK during runtime. Just hook in to the CharacterCreated callback on your UMA and add the following code:

1 using RootMotion.FinalIK;
3 vrik = go.AddComponent<VRIK>(); // Adding the component
4 vrik.AutoDetectReferences();
6 vrik.solver.leftArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;
7 vrik.solver.rightArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;