Create a gist now

Instantly share code, notes, and snippets.

@kihira /HandInfoPanel.cs Secret
Last active Apr 2, 2016

What would you like to do?
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