Sync IK
Options
Can you tell me how it is easier and best to synchronize ik?
using System.Collections; using System.Collections.Generic; using UnityEngine; using Photon.Pun; public class PlayerIKSystem : MonoBehaviourPunCallbacks { [Header("IK Parametres")] [Range(0f, 1f)] public float lookWeight; [Range(0f, 1f)] public float bodyWeight; [Range(0f, 1f)] public float headWeight; [Range(0f, 1f)] public float eyesWeight; [Range(0f, 1f)] public float clampWeight; [Header("Targets")] public Transform lookTarget; //[Header("Other Components")] Animator playerAnimator; PhotonView PV; private void Awake() { PV = GetComponent<PhotonView>(); } private void Start() { playerAnimator = GetComponent<Animator>(); } private void OnAnimatorIK() { playerAnimator.SetLookAtWeight(lookWeight, bodyWeight, headWeight, eyesWeight, clampWeight); playerAnimator.SetLookAtPosition(lookTarget.position); } }
0