Skip to content

Instantly share code, notes, and snippets.

@kihira
Last active April 2, 2016 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kihira/41c6af32842fe3b249cff37d38894105 to your computer and use it in GitHub Desktop.
Save kihira/41c6af32842fe3b249cff37d38894105 to your computer and use it in GitHub Desktop.
private void UpdatePosition()
{
// Less jittery to manually transform the position then add it as a child of the palm
// Palm position isn't in middle of palm, more it floats up and in front of it. not going insane trying to correct for that
Vector3 newPos = hand.GetPalmPosition() + hand.GetPalmRotation() * (Vector3.up * 0.1f);
transform.position = Vector3.Lerp(transform.position, newPos, Math.Abs(newPos.sqrMagnitude - transform.position.sqrMagnitude));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment