FBIKBendGoal.cs 724 B

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. using System.Collections;
  3. using RootMotion.FinalIK;
  4. namespace RootMotion.Demos {
  5. /// <summary>
  6. /// Bend goal for FullBodyBipedIK.
  7. /// </summary>
  8. public class FBIKBendGoal: MonoBehaviour {
  9. public FullBodyBipedIK ik; // Refernce to the FBBIK component
  10. public FullBodyBipedChain chain; // Which limb is this bend goal for?
  11. public float weight; // Bend goal weight
  12. void Start() {
  13. Debug.Log("FBIKBendGoal is deprecated, you can now a bend goal from the custom inspector of the FullBodyBipedIK component.");
  14. }
  15. void Update() {
  16. if (ik == null) return;
  17. ik.solver.GetBendConstraint(chain).bendGoal = transform;
  18. ik.solver.GetBendConstraint(chain).weight = weight;
  19. }
  20. }
  21. }