Person
public sealed class Person
Namespace: AR51.Unity.SDK
A plain runtime wrapper (not a MonoBehaviour) representing one tracked skeleton and its instantiated character model. Each Person is created and owned by SkeletonConsumer — you obtain instances from its Persons collection or TryGetPerson / GetPerson, never by constructing one yourself. The Person holds the solved and raw joint positions, per-joint confidence, the character Model, and bone/transform caches; its scaling and IK are driven each frame.
This page is reference (facts only). For the step-by-step connect → skeleton → character walkthrough, see the How-to guide.
All positions and lengths are Unity world-space meters (Vector3); rotations are Quaternion. Timestamps are seconds since the Unix epoch (UTC); durations are seconds.
Properties
| Property | Type | Description |
|---|---|---|
| Identity & state | ||
Id | string | the person's id — matches Skeleton.Id (the per-track / "PersonId") |
IsActivePerson | bool | true when this is the local/active person (nearest to the camera/headset) |
LastUpdate | DateTime | local time of the last skeleton update |
IsAPose | bool | true while the person is currently in an A-pose |
IsAutoScaled | bool | true once auto-scaling has been applied to the model |
| Character & model | ||
Character | AR51Character | the live character component driven by this person |
Model | GameObject | the instantiated character GameObject |
CharacterPrefab | AR51Character | the prefab Model was instantiated from |
Animator | Animator | the model's Animator |
TintColor | Color | tint applied to the model |
JointColor | Color | color used when drawing this person's joints/gizmo |
| Visibility | ||
IsModelVisible | bool | whether the character mesh is shown (see SetModelVisiblity) |
IsModelGameObjectActive | bool | whether Model is active in the hierarchy |
IsSkeletonVisible | bool | whether the skeleton gizmo is shown (see SetSkeletonVisible) |
| Joint data | ||
Positions | Vector3[] | solved joint positions (meters, world) — indexed by Joints |
RawPositions | Vector3[] | raw incoming joint positions (meters, world) before solve |
Confidence | float[] | per-joint confidence, parallel to Positions |
HeadPosition | Vector3 | midpoint of the eyes (meters) |
LastSkeleton | Skeleton | the most recent skeleton payload (get/set) |
| Timing | ||
CreationTime | double | capture time when first seen (Unix seconds) |
TimeSinceCreation | double | seconds since first seen |
| Bones & rig caches | ||
RootBoneDFS | Transform[] | bones in depth-first order from the root |
Bones | Transform[] | mapped rig bones |
AnimatedBones | Transform[] | bones driven by the animator |
HeadJoint / NeckJoint | Transform | head / neck bone transforms |
HeadInitRotation | Quaternion | head bone rotation at bind time |
NeckInitLocalRotation | Quaternion | neck bone local rotation at bind time |
LeftWristJoint / RightWristJoint | Transform | wrist bone transforms |
LeftWristJointDFS / RightWristJointDFS | Transform[] | wrist sub-trees in depth-first order |
| Visualization & physics | ||
JointGizmos | JointGizmo[] | per-joint gizmo components |
C3DPoints | C3DPoint[] | C3D marker points |
ParentConstraints | ParentConstraint[] | parent constraints on the rig |
Colliders | Collider[] | the model's colliders |
IdLabel | GameObject | optional world-space id label (get/set) |
AutoScaleModeOverride | AutoScaleMode | per-person auto-scale override |
Method summary
| Method | Returns | |
|---|---|---|
GetPosition | Vector3 | instance |
GetRawPosition | Vector3 | instance |
GetAverageConfidence | float | instance |
SetModelVisiblity | void | instance |
SetSkeletonVisible | void | instance |
SetActive | void | instance |
GetHeadRotation / SetHeadRotation | Quaternion / void | instance |
ApplyAutoScale / ResetScale | void | instance · overloads |
Update | void | consumer-driven |
SolveIK | void | consumer-driven |
DrawGizmo | void | instance |
DestroyModels | void | instance |
→ Full descriptions in Method details below.
Update and SolveIK are public for advanced/manual driving, but in normal use you do not call them — SkeletonConsumer feeds new positions and runs the solve for every person each LateUpdate. Read Positions / Confidence / Model and toggle visibility instead.
Method details
GetPosition
public Vector3 GetPosition(int jointIndex);
The solved world position (meters) of a single joint — equivalent to Positions[jointIndex] with bounds safety.
var person = SkeletonConsumer.Instance.ActivePerson;
Vector3 rightWrist = person.GetPosition(Joints.RWrist); // meters, world
GetRawPosition
public Vector3 GetRawPosition(int jointIndex);
The raw incoming world position (meters) of a joint, before scaling/IK — equivalent to RawPositions[jointIndex].
GetAverageConfidence
public float GetAverageConfidence();
The mean confidence across the joints that have a confident reading — a quick overall tracking-quality signal.
-1 when none are confidentforeach (var person in SkeletonConsumer.Instance.Persons)
{
float quality = person.GetAverageConfidence();
if (quality >= 0f && quality < 0.3f)
Debug.Log($"Low tracking quality for {person.Id}: {quality:F2}");
}
SetModelVisiblity
public void SetModelVisiblity(bool visible);
Show or hide the character mesh. Reflected by IsModelVisible. (Note the method's Visiblity spelling.)
true to render the model, false to hide itSetSkeletonVisible
public void SetSkeletonVisible(bool visible);
Show or hide the skeleton gizmo for this person. Reflected by IsSkeletonVisible.
true to draw the skeleton gizmo, false to hide itSetActive
public void SetActive(bool isActive);
Activate or deactivate the person's Model GameObject as a whole.
true to activate the model, false to deactivate itHead rotation
public Quaternion GetHeadRotation();
public void SetHeadRotation(Quaternion rotation);
Read or override the head bone rotation — set it to fuse a headset's orientation onto the tracked person.
ApplyAutoScale
public void ApplyAutoScale();
public void ApplyAutoScale(AutoScaleMode mode);
public void ApplyAutoNonUniformScale(Func<int, int, float> getLengthFunc);
public void ResetScale();
Rescale the character's bone lengths to match the tracked person. ApplyAutoScale() uses the configured mode; pass an AutoScaleMode to override it. ApplyAutoNonUniformScale scales per bone pair using the supplied length function. ResetScale() restores the unscaled rig. Sets IsAutoScaled.
(fromJoint, toJoint) pair (meters)Update
public void Update(Vector3[] positions);
Feed a new set of joint positions (meters, world) into the person, refreshing RawPositions and LastUpdate. Called by SkeletonConsumer each frame — public only for advanced manual driving.
SolveIK
public void SolveIK();
Run the IK / character solve for this person, driving Character toward the current positions and producing Positions. Driven by SkeletonConsumer in LateUpdate; do not call it yourself in normal use.
DrawGizmo
public void DrawGizmo(Color color);
Draw this person's skeleton gizmo in the given color (debug visualization).
DestroyModels
public void DestroyModels();
Destroy the instantiated character model and associated GameObjects for this person. Normally invoked by the consumer when the person is removed.
PersonEventArgs
classpublic class PersonEventArgs
Namespace: AR51.Unity.SDK
The payload for the person-lifecycle events raised by SkeletonConsumer — OnPersonCreated, OnPersonDeleting, and OnPersonDeleted. It carries the affected Person.
| Member | Type | Description |
|---|---|---|
Person | Person | the person this event concerns |
public PersonEventArgs(Person person);
SkeletonConsumer.Instance.OnPersonCreated += (sender, e) =>
{
Person p = e.Person;
Debug.Log($"Character spawned for {p.Id}; head at {p.HeadPosition} (meters)");
};
See also
SkeletonConsumer— owns and drives everyPerson; source ofPersonEventArgsSkeleton— the per-frame payload behindLastSkeleton; shares theIdJoints— joint-index map forPositions/Confidence/GetPositionAR51Character— the mocap-driven character this person owns- Class index — all Unity SDK types