Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Character flys away from an unmodified SetHumanPose?

Discussion in 'Animation' started by CloudyVR, Feb 11, 2020.

  1. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    714
    I am simply retrieving and immediately setting the same `humanPose` for my character for testing. I would expect there to be no change, but instead my character flys away:

    Code (csharp):
    1. humanPoseHandler.GetHumanPose(ref humanPose);
    2. humanPoseHandler.SetHumanPose(ref humanPose);
    Why would this be? It appears that the hips bone of my humanoid is integrating some error and the position changes by a constant value.

    Why is this happening only to the hips? How can I prevent it from occurring?

    [EDIT]

    I tired setting the bodyPosition and bodyRotation but character moves to random location:
    Code (csharp):
    1. humanPoseHandler.GetHumanPose(ref humanPose);
    2. humanPose.bodyPosition = Vector3.zero;
    3. humanPose.bodyRotation = Quaternion.identity;
    4. humanPoseHandler.SetHumanPose(ref humanPose);
    Now the character is not at the origin!!! It sits somewhere random and I don't know why.

    --

    Also I see different behavior if the animator is enabled, but I need the animator disabled.
     
    Last edited: Feb 11, 2020