CVR Attachment
Attaches a GameObject to a bone, tracker, or snapping point. Useful for hats, glasses, or any prop that needs to stick to a specific part of an avatar or another prop. Runs with a high DefaultExecutionOrder (16000) so it can update after most IK / animation work.
Fields
Section titled “Fields”Attachment Type
Section titled “Attachment Type”AttachmentType flag enum (any combination):
Bone— match against an avatar humanoid bone.Tracker— match against a camera / controller / additional tracker.SnappingPoint— match against aCVRSnappingPoint.
The internal attach pass prioritises SnappingPoint, then Tracker, then Bone.
Bone Type
Section titled “Bone Type”BoneType flag enum. Valid bones: Hips, Spine, Chest, UpperChest, Neck, Head, LeftUpperLeg, LeftLowerLeg, LeftFoot, RightUpperLeg, RightLowerLeg, RightFoot, LeftShoulder, LeftArm, LeftForearm, LeftHand, RightShoulder, RightArm, RightForearm, RightHand, Root (avatar root transform). Multiple bones can be selected; the closest is picked.
Tracker Type
Section titled “Tracker Type”TrackerType flag enum: MainCamera, LeftHand, RightHand, AdditionalTracker. Again, the closest matching transform is picked.
Snapping Point Types
Section titled “Snapping Point Types”List<string>. Filters which CVRSnappingPoint.type values this attachment will accept.
Max Attachment Distance
Section titled “Max Attachment Distance”float. Maximum distance from a candidate transform at which the attachment will engage. If set to 0, distance is ignored.
Normalize Bone Attachment
Section titled “Normalize Bone Attachment”bool. When the attachment is made to a humanoid bone, use the IK system’s BoneCalibrationData to convert the inspector-specified position / rotation offsets into bone-local space scaled by the play-space scale. Produces consistent placement across avatars with different proportions.
Use Fixed Position Offset
Section titled “Use Fixed Position Offset”bool. When true, apply positionOffset directly instead of sampling the object’s current offset from the attachment point.
Use Fixed Rotation Offset
Section titled “Use Fixed Rotation Offset”bool. When true, align to the attachment’s rotation times Quaternion.Euler(rotationOffset) instead of preserving the current object rotation.
Position Offset / Rotation Offset
Section titled “Position Offset / Rotation Offset”Vector3. Offsets relative to the bone / tracker / snapping point.
Collision With Player
Section titled “Collision With Player”CollisionWithPlayer enum (default DisableWhileHeld). Same values as on CVR Pickup Object: DisableWhileHeldAndColliding, DisableWhileHeld, DontDisable.
On Attach / On DeAttach
Section titled “On Attach / On DeAttach”UnityEvent. Called when the attachment is made / released. Self-call recursion into the component is disabled at Start via UnityEventsHelper.DisableCallsToSelf.
Runtime API
Section titled “Runtime API”Attach()— request attachment; resolved on the next late-update pass.Attach(InteractionContext)— attachment-gated variant used by trigger actions.DeAttach()— release; zeros the attached transform and firesonDeattach.IsAttached()— true while attached. ForSnappingPointattachments, also requires the target to be active and enabled.ShouldSync(int depth = 0)— used byCVRSpawnableto decide whether this client is authoritative for the carrier prop. FollowsSnappingPointchains up to depth 10.AnimEventAttach(AnimationEvent)/AnimEventDeAttach(AnimationEvent)— animation-event entry points guarded byInteractionContext.ShouldExecuteAttachment.
Related
Section titled “Related”Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRAttachment.cs