Table of Contents

Class ConstraintTargetController

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

bool

HeadTarget

public ConstraintTarget HeadTarget { get; }

Property Value

ConstraintTarget

LeftHandTarget

public ConstraintTarget LeftHandTarget { get; }

Property Value

ConstraintTarget

LeftLegTarget

public ConstraintTarget LeftLegTarget { get; }

Property Value

ConstraintTarget

MasterWeight

public float MasterWeight { get; set; }

Property Value

float

RigReferences

public RigReferences RigReferences { get; }

Property Value

RigReferences

RightHandTarget

public ConstraintTarget RightHandTarget { get; }

Property Value

ConstraintTarget

RightLegTarget

public ConstraintTarget RightLegTarget { get; }

Property Value

ConstraintTarget

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

leftHand Transform
rightHand Transform

SetHeadLookAt(Transform)

Sets the source transform for the head to look at.

public void SetHeadLookAt(Transform lookAtTarget)

Parameters

lookAtTarget Transform

SetLegTargets(Transform, Transform)

Sets the source transforms for both legs/feet.

public void SetLegTargets(Transform leftLeg, Transform rightLeg)

Parameters

leftLeg Transform
rightLeg Transform

SetPositionConstraint(BodyPart, bool)

Enables/disables position constraint for a specific body part.

public void SetPositionConstraint(ConstraintTargetController.BodyPart part, bool enabled)

Parameters

part ConstraintTargetController.BodyPart
enabled bool

SetRotationConstraint(BodyPart, bool)

Enables/disables rotation constraint for a specific body part.

public void SetRotationConstraint(ConstraintTargetController.BodyPart part, bool enabled)

Parameters

part ConstraintTargetController.BodyPart
enabled bool

SetWeight(BodyPart, float)

Sets the weight for a specific body part constraint.

public void SetWeight(ConstraintTargetController.BodyPart part, float weight)

Parameters

part ConstraintTargetController.BodyPart
weight float

SnapAll()

Snaps all constraints instantly to their sources.

public void SnapAll()

UpdateAllConstraints()

Call this manually when UpdateMode is set to Manual.

public void UpdateAllConstraints()