Created
November 12, 2016 13:55
-
-
Save tetya/c14a8c57a27da75d014965c1b97631db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using RootMotion.FinalIK; | |
public class HoldCube : MonoBehaviour { | |
public FullBodyBipedIK ik; | |
public Transform leftHandTarget, rightHandTarget; | |
// Update is called once per frame | |
void LateUpdate () { | |
//左手 | |
ik.solver.leftHandEffector.position = leftHandTarget.position; | |
ik.solver.leftHandEffector.rotation = leftHandTarget.rotation; | |
ik.solver.leftHandEffector.positionWeight = 1f; | |
ik.solver.leftHandEffector.rotationWeight = 1f; | |
//右手 | |
ik.solver.rightHandEffector.position = rightHandTarget.position; | |
ik.solver.rightHandEffector.rotation = rightHandTarget.rotation; | |
ik.solver.rightHandEffector.positionWeight = 1f; | |
ik.solver.rightHandEffector.rotationWeight = 1f; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment