Skip to content

MotionMatchingCharacterController stomping Unity IK in Late Update #9

@jhughes2112

Description

@jhughes2112

I spent a good part of the day trying to figure out why IK was rotated wrong. We do head tracking sometimes in another layer. I finally discovered that we were taking the SkeletonTransform list and applying them in OnSkeletonTransformUpdated, which happens in LateUpdate. That overwrites transforms because IK happens before this.

Our setup has a character controller that is physical and roams around the world as a capsule, and a set of joints and a skinned mesh. That does not animate, per se, but it is assigned the outcomes from a blend of what our Animator and MotionMatching give us. There is a separate object that has the MotionMatching scripts on it, has a separate copy of the skeleton but no meshes and no colliders. We feed it trajectory information and it moves around the world (invisibly) and animates. We scrape the skeleton to get the animation data, essentially.

I was considering making a Playables object that would represent the Motion Matching animation data, that could then easily be integrated and interpolated into/out of when we needed more control or wanted to use traditional animation. That would be absolutely fantastic.

Anyway, questions.

  1. It's unclear if we are set up properly. And if we are, LateUpdate is not a good place to grab joint information because it stomps IK and other blended animation data.

  2. We do not get the benefit of foot locking because our actual character moves according to physics not animation data. Would be great if there was a clean way to snap the motion matching object to where our character is, so it could do useful things like foot IK for us in the actual coordinate space we are in.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions