Version: 1.10
LanguageEnglish
  • C#

ChildReference

struct in UnityEngine.Animations

/

Implemented in:UnityEngine.AnimationModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Represents a child reference point on the constrained object's hierarchy.

Child references define points on the constrained object (typically child transforms) that the constraint uses as evaluation origins instead of the constrained object itself. This is fundamentally different from ConstraintSource, which specifies external targets to follow.

When child references are set, the constraint solves for the parent transform such that the weighted child reference points align with the constraint target, rather than aligning the parent object directly. For example, in an AimConstraint, the parent rotates so that the specified child point aims at the target, allowing indirect aiming from an offset position. In a ParentConstraint, child references act as anchor points from which offsets are calculated instead of using per-source offsets.

If multiple child references are provided, their positions and rotations are combined using weighted averaging. The weight of each child reference determines its relative influence in this combination.

Properties

transformThe transform component of the child reference object.
weightThe weight of the child reference in the evaluation of the constraint.