Class ConstraintTargetController
- Namespace
- WitShells.AnimationRig
Main controller for managing multiple constraint targets. Attach this to your character and assign transform references to make constraints follow targets.
public class ConstraintTargetController : MonoBehaviour
- Inheritance
-
ConstraintTargetController
Properties
EnableConstraints
public bool EnableConstraints { get; set; }
Property Value
HeadTarget
public ConstraintTarget HeadTarget { get; }
Property Value
LeftHandTarget
public ConstraintTarget LeftHandTarget { get; }
Property Value
LeftLegTarget
public ConstraintTarget LeftLegTarget { get; }
Property Value
MasterWeight
public float MasterWeight { get; set; }
Property Value
RigReferences
public RigReferences RigReferences { get; }
Property Value
RightHandTarget
public ConstraintTarget RightHandTarget { get; }
Property Value
RightLegTarget
public ConstraintTarget RightLegTarget { get; }
Property Value
Methods
ClearAllSources()
Clears all source references.
public void ClearAllSources()
ResetAll()
Resets all constraints.
public void ResetAll()
SetHandTargets(Transform, Transform)
Sets the source transforms for both hands.
public void SetHandTargets(Transform leftHand, Transform rightHand)
Parameters
leftHandTransformrightHandTransform
SetHeadLookAt(Transform)
Sets the source transform for the head to look at.
public void SetHeadLookAt(Transform lookAtTarget)
Parameters
lookAtTargetTransform
SetLegTargets(Transform, Transform)
Sets the source transforms for both legs/feet.
public void SetLegTargets(Transform leftLeg, Transform rightLeg)
Parameters
leftLegTransformrightLegTransform
SetPositionConstraint(BodyPart, bool)
Enables/disables position constraint for a specific body part.
public void SetPositionConstraint(ConstraintTargetController.BodyPart part, bool enabled)
Parameters
partConstraintTargetController.BodyPartenabledbool
SetRotationConstraint(BodyPart, bool)
Enables/disables rotation constraint for a specific body part.
public void SetRotationConstraint(ConstraintTargetController.BodyPart part, bool enabled)
Parameters
partConstraintTargetController.BodyPartenabledbool
SetWeight(BodyPart, float)
Sets the weight for a specific body part constraint.
public void SetWeight(ConstraintTargetController.BodyPart part, float weight)
Parameters
partConstraintTargetController.BodyPartweightfloat
SnapAll()
Snaps all constraints instantly to their sources.
public void SnapAll()
UpdateAllConstraints()
Call this manually when UpdateMode is set to Manual.
public void UpdateAllConstraints()