UNITY3D運行動畫時修改局部骨骼的角度
2019/2/14 點擊:
當UNITY3D中動畫播放(fàng)時,有時(shí)需要修改局部骨(gǔ)骼的角度(dù)或者(zhě)位置, 怎麽辦? 上代碼:
private void OnAnimatorIK(int layerIndex)
{
float angle_Z = Vector3.Angle(player.position - transform.position, transform.forward);
Debug.Log(angle_Z);
animator.SetBoneLocalRotation(HumanBodyBones.Head, Quaternion.Euler(0, 0, angle_Z));
}
- 上一篇:Unity3D 骨骼動畫原理小(xiǎo)記 2019/2/14
- 下一篇:電腦Unity上可用,部署到hololens眼鏡上(shàng)失效(xiào) 2019/2/3