Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Root motion animated character with manual Y rotation of character.

Discussion in 'Animation' started by mariusgeorge, Nov 8, 2018.

  1. mariusgeorge

    mariusgeorge

    Joined:
    Jan 29, 2016
    Posts:
    5
    Well... I have spent hours breaking my head against this.

    I have an animation controller with a bunch of root motion animation states set up.

    I have a third person orbital camera that looks at the character.

    At the start, the character is in a crouched position. When rotating the camera around the character, some root motion crouch rotations will kick in to turn the character where the camera is facing. Works perfectly.

    When W is pressed, the character goes into a walk animation. Also root motion, also works as expected.

    However, I want to turn the character based on the direction the camera is facing.

    This has proved to be impossible or at least difficult enough so that I can't figure it out.

    Setting the character's gameobject rotation manually works - but the root motion gets stuck in the original direction. Setting the character's Animator's "rootRotation" and/or "bodyRotation" quaternions in OnAnimatorIK rotates the character, but the root motion coming from the animation is then stuck on the original plane, and the character just slides in place.

    What's going on here?

    How does one manually rotate a character that is using root motion based animation?

    Extra info:
    - The animator is on the root gameobject.
    - I have played with all the various animation objects for IK, like rotation "based on", position "based on", etc.

    Please help!

    Thanks,

    Marius George