> For the complete documentation index, see [llms.txt](https://finite-machine-studio.gitbook.io/vatmachine-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://finite-machine-studio.gitbook.io/vatmachine-documentation/socket-system.md).

# Socket System

Common socket uses:

* Weapons
* Shields
* Hats
* Backpacks
* Hand props
* VFX spawn points
* Head attachments

<div align="left"><figure><img src="/files/LMkqnXrcRHVRkNGFvxXs" alt="" width="365"><figcaption><p>Sockets section in the VAT Baker</p></figcaption></figure></div>

### Adding Sockets

To add sockets:

1. Add a new socket entry, or select bones/transforms and use Add Selected Bones.
2. Assign the socket Transform.
3. Give the socket a clear name.
4. Bake the animations.

### Socket Rules&#xD;

* Socket transforms must be children of the selected source object.
* Socket names must be unique.
* If the socket name is empty, VATMachine uses the transform name.
* If a runtime animation needs an attachment, the socket should be baked into every animation that can play on that character.

### What Socket Data Stores&#xD;

For every baked frame, VATMachine stores the socket’s:

* Local position
* Local rotation

At runtime, VATAnimator can sample this socket pose.

VATSocketLink can then apply the socket pose to an object automatically.

### Using Sockets at Runtime

Add VATSocketLink to the object you want to attach.

Assign:

* VATAnimator
* Socket Name

Then choose whether the socket should apply:

* Position
* Rotation
* Animator Local space
* World space

You can also change the socket name from code.

### Socket Baking Tip: Use Pre-Aligned Holder Transforms

For props that move between different attachment points, such as a sword moving from the hip to the hand, it is highly recommended to create dedicated holder transforms before baking.

Instead of baking the raw hand bone or hip bone directly, create separate holder GameObjects and align them exactly how the prop should sit at each attachment point.

#### Example from the Events\_Demo:

The character has three animations:

* Sword unsheathing
* Sword slash
* Sword sheathing

The sword needs to be attached to the hand during the attack, then placed back on the hip during the sheathing animation.

A good setup is:

* SwordHandHolder
* SwordHipHolder

The sword itself should be aligned under these holders with zero local position and zero local rotation.

Recommended workflow:

1. In the original animated character rig, create an empty GameObject called SwordHandHolder.
2. Parent SwordHandHolder under the hand bone.
3. Place the sword under SwordHandHolder.
4. Set the sword’s local position and local rotation to zero.
5. Adjust SwordHandHolder until the sword is held correctly in the character’s hand.
6. Go to the frame where the sword should be placed back on the hip.
7. Duplicate SwordHandHolder and rename it SwordHipHolder.
8. Parent SwordHipHolder under the hip bone.
9. Keep the duplicated holder aligned so the sword keeps the same world position and rotation at the transfer frame.
10. Bake both SwordHandHolder and SwordHipHolder as VAT sockets.
11. At runtime, switch the VATSocketLink Socket Name between SwordHandHolder and SwordHipHolder.

This makes the socket transition much cleaner.

Instead of manually editing position and rotation offsets in VATSocketLink, the offset is already built into the baked socket transform. VATSocketLink can use zero offset values, and the sword will still line up correctly.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://finite-machine-studio.gitbook.io/vatmachine-documentation/socket-system.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
