AR51Character
[RequireComponent(typeof(Animator))]
public class AR51Character : MonoBehaviour
Namespace: AR51.Unity.SDK
The component you add to a humanoid character prefab to make it drivable by the SDK. It validates the rig, maps Unity HumanBodyBones to its CharacterBones Transform map, exposes the VR device controllers, and is solved toward incoming skeleton data (body / foot / spine / finger IK) every frame. Add your finished prefab to SkeletonConsumer.CharacterPrefabs; the consumer instantiates one model per tracked person and owns the Person that drives it.
This page is reference (facts only). For the step-by-step connect → drive a character walkthrough, see the How-to guide.
Unity positions and lengths are world-space Vector3 in meters; rotations are Quaternion; angles in degrees.
Properties
Public, Inspector-assigned unless noted. Assign the bone/controller Transforms on the prefab.
| Property | Type | Default | Description |
|---|---|---|---|
| Bone mapping | |||
Bones | CharacterBones | — | the rig's bone-Transform map (see CharacterBones) |
Person | Person | — | the tracked person currently driving this character (set by the consumer) |
World | Transform | — | the space the character is solved in |
LeftForearmTwistJoint | Transform | — | optional left wrist-twist bone |
RightForearmTwistJoint | Transform | — | optional right wrist-twist bone |
| Device controllers | |||
LeftDeviceController | Transform | — | Transform driven by the left VR controller |
RightDeviceController | Transform | — | Transform driven by the right VR controller |
| Auto scale | |||
CharacterHeight | float | 1.0 | character height in meters, used by advanced non-uniform scaling |
| Foot contact | |||
LeftFootBounds | Transform | — | left-foot contact-bounds Transform |
RightFootBounds | Transform | — | right-foot contact-bounds Transform |
| Runtime (read-mostly) | |||
Animator | Animator | — | the required humanoid Animator (read-only) |
FootContactSticky | FootContactSticky | — | foot-contact stick state (read-only) |
MoveLimbs | bool | — | whether limb IK is applied |
Method summary
Instance
| Method | Returns | |
|---|---|---|
ValidateCharacter | bool | Unity component |
GetMissingRequiredMappings | List<string> | Unity component |
GetButtonStatus | ControllerButtonStatus | Unity component |
GetAllButtonStatus | List<Tuple<ControllerButton, ControllerButtonStatus>> | Unity component |
Static
| Method | Returns | |
|---|---|---|
GetOrderedLimbPairs | (HumanBodyBones, HumanBodyBones)[] | static |
→ Full descriptions in Method details below.
Method details
ValidateCharacter
public bool ValidateCharacter();
Checks that the prefab is a valid humanoid with all required bones and bounds assigned. Call it at setup (per prefab) before relying on a character — an invalid rig will not solve correctly.
true if the rig is a valid humanoid with the required bones mappedforeach (var prefab in SkeletonConsumer.Instance.CharacterPrefabs)
if (!prefab.ValidateCharacter())
Debug.LogError("Invalid rig: " + string.Join(", ", prefab.GetMissingRequiredMappings()));
GetMissingRequiredMappings
public List<string> GetMissingRequiredMappings();
Returns the labels of the required bones/bounds that are not assigned. Use it to report exactly what a prefab is missing when ValidateCharacter returns false.
GetButtonStatus
public ControllerButtonStatus GetButtonStatus(ControllerButton button, bool isLeft = false);
public List<Tuple<ControllerButton, ControllerButtonStatus>> GetAllButtonStatus(bool isLeft = false);
Read the VR controller button state for this character's person. GetButtonStatus reads one button; GetAllButtonStatus returns every button with its current status. Pass isLeft = true for the left controller.
true for the left controller, false (default) for the rightControllerButton and ControllerButtonStatus are transport enums (AR51.GRPC.CVS); they are surfaced here but not detailed as public types.
GetOrderedLimbPairs
public static (HumanBodyBones left, HumanBodyBones right)[] GetOrderedLimbPairs();
The canonical left/right HumanBodyBones limb pairs, in solve order — useful when iterating bones symmetrically.
CharacterBones
[Serializable] class Unity component[Serializable]
public class CharacterBones
Namespace: AR51.Unity.SDK
The Inspector bone-Transform map assigned to AR51Character.Bones. Each field is a Transform on your rig that the solver drives; assign them in the Inspector (or let validation report any that are missing). Bones:
| Bone | Type | Description |
|---|---|---|
| Core / spine | ||
root | Transform | rig root |
Hips | Transform | hips / pelvis |
Spine | Transform | spine |
Neck | Transform | neck |
head | Transform | head |
| Left arm | ||
LeftShoulder | Transform | left shoulder |
LeftElbow | Transform | left elbow |
LeftWrist | Transform | left wrist |
| Right arm | ||
RightShoulder | Transform | right shoulder |
RightElbow | Transform | right elbow |
RightWrist | Transform | right wrist |
| Left leg | ||
LeftHip | Transform | left hip |
LeftKnee | Transform | left knee |
leftFoot | Transform | left foot |
LeftToe | Transform | left toe |
| Right leg | ||
RightHip | Transform | right hip |
RightKnee | Transform | right knee |
rightFoot | Transform | right foot |
RightToe | Transform | right toe |
Related types
These types support AR51Character but do not have their own page — see the Skeletons & Characters area page:
CharacterMapping— Inspector mapping from an entity id / display name to a character prefab.CharacterMappingHelper—TryFindextension that resolves a prefab by mapping name.AutoScaleMode— how the character's bone lengths are rescaled to match the tracked person (Disabled/NonUniform/Uniform/AdvancedNonUniform).CharacterValidation— rig-validation helpers (AR51.Unity.SDK.Utilities) used byValidateCharacter.
The IK / character solver behind this component is proprietary and treated as a black box: the per-frame body/foot/spine/finger solve, bone-length auto-scaling, and the internal solver types (IKSolver and friends) are not part of the documented public surface. You assign the rig and call ValidateCharacter; the SDK drives it.
See also
SkeletonConsumer— instantiates and drives oneAR51Characterper tracked personPerson— the runtime wrapper that owns this character's model and solved jointsSkeleton— the per-frame mocap payload that drives the characterJoints— joint-index map for the incoming position arrays- Class index — all Unity SDK types
- How-to: connect → drive a character