How can I customise skeleton accounts

Asked on 2024-07-30

1 search

To customize skeleton accounts in Reality Composer Pro, you can use the skeletal poses API. This API allows you to modify the skeleton at runtime by programmatically querying the skeletal poses component or a specific joint and updating the transforms on it. Here are the steps you can follow:

  1. Initialize the IK Rig: Define how the inverse kinematics (IK) solver should work by giving the IK rig the model skeleton and a configuration such as the number of iterations. If you're playing an animation on the same entity, you need to give weights to the animation and weights for IK so the solver will know what to override.

  2. Add Constraints: Constraints are limitations on how the joints can change, preventing unnatural movements like bending an elbow in the wrong direction. Create an IK resource from the IK rig defined and then create an IK component from the IK resource. Add this component to an entity.

  3. Update at Runtime: You can set up this solver on instantiation of the component and update it at runtime as often as every frame. RealityKit's IK solver will solve over the full character skeleton simultaneously, not just on a subset of the joint hierarchy.

  4. Modify Skeletal Poses: Use the skeletal poses API to make specific joints rotate or move. For example, you can make a robot's neck bone rotate as if it's watching a butterfly flutter around. This involves grabbing the skeletal poses component from the entity and updating the rotation of the joints in local space to have the neck rotation update on every frame.

For more detailed information, you can refer to the session Compose interactive 3D content in Reality Composer Pro at the timestamp 31:17.

Relevant Sessions

  1. Compose interactive 3D content in Reality Composer Pro
  2. Break into the RealityKit debugger
  3. Explore game input in visionOS

These sessions provide comprehensive insights into customizing skeletons and using inverse kinematics in RealityKit.