blob: 600fe27454716c81e26ee547b9262ed6a8ece7f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class IKTest : MonoBehaviour
{
public GameObject Go_FootIK;
[Range(0,1)]
public float IKWeight;
private Animator animator;
private void OnAnimatorIK(int layerIndex)
{
if(animator == null)
{
animator = GetComponent<Animator>();
}
animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, IKWeight);
animator.SetIKPosition(AvatarIKGoal.LeftFoot, Go_FootIK.transform.position);
animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, IKWeight);
animator.SetIKRotation(AvatarIKGoal.LeftFoot, Go_FootIK.transform.rotation);
}
}
|