Added checks on the existence of a target rig
This commit is contained in:
parent
84b75d5750
commit
5d8e3fbcb7
@ -789,7 +789,7 @@ namespace Passer.Humanoid {
|
||||
public static void DetermineTarget(HumanoidControl humanoid, bool isLeft) {
|
||||
FootTarget footTarget = isLeft ? humanoid.leftFootTarget : humanoid.rightFootTarget;
|
||||
|
||||
if (footTarget == null) {
|
||||
if (footTarget == null && humanoid.targetsRig != null) {
|
||||
Transform footTargetTransform = humanoid.targetsRig.GetBoneTransform(isLeft ? HumanBodyBones.LeftFoot : HumanBodyBones.RightFoot);
|
||||
if (footTargetTransform == null) {
|
||||
Debug.LogError("Could not find foot bone in targets rig");
|
||||
|
@ -1343,7 +1343,7 @@ namespace Passer.Humanoid {
|
||||
public static void DetermineTarget(HumanoidControl humanoid, bool isLeft) {
|
||||
HandTarget handTarget = isLeft ? humanoid.leftHandTarget : humanoid.rightHandTarget;
|
||||
|
||||
if (handTarget == null) {
|
||||
if (handTarget == null && humanoid.targetsRig != null) {
|
||||
Transform handTargetTransform = humanoid.targetsRig.GetBoneTransform(isLeft ? HumanBodyBones.LeftHand : HumanBodyBones.RightHand);
|
||||
if (handTargetTransform == null) {
|
||||
Debug.LogError("Could not find hand bone in targets rig");
|
||||
|
@ -823,7 +823,7 @@ namespace Passer.Humanoid {
|
||||
public static void DetermineTarget(HumanoidControl humanoid) {
|
||||
HeadTarget headTarget = humanoid.headTarget;
|
||||
|
||||
if (headTarget == null) {
|
||||
if (headTarget == null && humanoid.targetsRig != null) {
|
||||
Transform headTargetTransform = humanoid.targetsRig.GetBoneTransform(HumanBodyBones.Head);
|
||||
if (headTargetTransform == null) {
|
||||
Debug.LogError("Could not find head bone in targets rig");
|
||||
|
@ -581,7 +581,7 @@ namespace Passer.Humanoid {
|
||||
public static void DetermineTarget(HumanoidControl humanoid) {
|
||||
HipsTarget hipsTarget = humanoid.hipsTarget;
|
||||
|
||||
if (hipsTarget == null) {
|
||||
if (hipsTarget == null && humanoid.targetsRig != null) {
|
||||
Transform hipsTargetTransform = humanoid.targetsRig.GetBoneTransform(HumanBodyBones.Hips);
|
||||
if (hipsTargetTransform == null) {
|
||||
Debug.LogError("Could not find hips bone in targets rig");
|
||||
|
Loading…
x
Reference in New Issue
Block a user