> For the complete documentation index, see [llms.txt](https://mindcodeinteractive.gitbook.io/easy-build-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mindcodeinteractive.gitbook.io/easy-build-system/learning/beginner-guides/building-socket-guide.md).

# Building Socket Guide

This guide walks you through creating and configuring a [Building Socket](/easy-build-system/reference/building-socket.md).

***

### Understand How Sockets Work

Sockets are invisible snap points that define where parts connect.

A floor has sockets along its edges where walls can attach.\
A wall has a socket on top where a roof can sit.

When the player previews a matching part nearby, it locks into the socket's position.

Each socket holds one or more snapping points.\
A snapping point declares "this part fits here, and when it snaps, use this offset".

A single socket can hold several snapping points.\
That's how one floor corner can accept walls, fences, or pillars.\
The system picks the right one based on what the player is holding.

The [Building Manager](/easy-build-system/reference/building-manager.md) has a dedicated `Socket` layer.\
Sockets must live on this layer or the system won't detect them.

### Create the Building Socket

Open your [Building Part](/easy-build-system/reference/building-part.md) prefab in edit mode.\
Create an empty child GameObject where you want the snap point to sit.\
Common spots are the corner of a floor, the top of a wall, or the front of a vehicle.

With that empty selected, go to:

`Tools > MCI > Easy Build System > Components > Create Building Socket...`

Or right-click in the Hierarchy:

`MCI > Easy Build System > Components > Create Building Socket...`

The tool creates a child named "New Building Socket" under your selection.\
It adds the [Building Socket](/easy-build-system/reference/building-socket.md) component, sets the correct layer, and frames it in the Scene view.

Move and rotate the socket transform until it sits where the connecting part should anchor.\
The socket's position is the snap target. Its rotation defines the facing of whatever attaches to it.

### Configure the Socket

The socket itself has only a few fields, and each one shapes how the snap behaves.

**Socket Type** is a label for the socket itself.

Use it to reference specific socket categories from scripts or filtering logic.\
It doesn't affect snap matching on its own. Matching happens through Snapping Points.\
Leave it empty unless you have a reason to tag it.

**Socket Property** is the priority value (0 to 100).

When the preview is within range of multiple sockets, the highest property wins.\
Most of the time you can leave this at 0.\
Bump it up only when two sockets compete and you want one to win consistently.\
A common case is a corner where a `floor edge` and a `wall side` socket overlap.\
Raise the priority on whichever should be preferred.

**Socket Radius** is how close the preview needs to be before snapping kicks in.

The default 0.25 is tight and requires the player to aim near the socket.\
Increase it to 0.5 or 1.0 if your parts are large and players need a forgiving snap.\
Decrease it if you have many sockets close together and snaps are getting confused.

<figure><img src="/files/zsvDqMs4NDsKTdBqvvZv" alt="" width="563"><figcaption></figcaption></figure>

### Add Snapping Point

This is where the actual snap logic lives. A socket with no snapping points doesn't do anything.

Click **Add Snapping Point** and configure it.

**Match Type** decides how the snapping point identifies what fits:

* **Reference** matches a specific [Building Part](/easy-build-system/reference/building-part.md) prefab. Only that exact part will snap.\
  Use this when you need precision, like "only this roof piece fits this wall top".
* **Category** matches any part whose Category tag matches.\
  Use this for flexibility, like "any part tagged Wall fits this floor edge".

Category matching is what you'll want most of the time.\
It keeps your sockets working when you add new part variants later.

Once you've picked the match type, fill in the corresponding field.\
Use **Part Reference** for Reference mode, or **Category** for Category mode.

The three offset fields define how the part is placed when it snaps in:

* **Position Offset** shifts the part from the socket's position.
* **Rotation Offset** rotates it from the socket's facing.
* **Scale Offset** multiplies its scale.

Most of the time you'll leave these at zero or one.\
The socket's transform handles alignment by default. The offsets are useful for fine-tuning.

A common case is a wall socket where the wall needs to sit half its width forward.\
That offset goes in Position Offset.

You can add multiple snapping points to a single socket.\
Each one can match a different part or category, with its own offsets.

This lets one socket on a floor edge accept walls, fences, or pillars\
Each part type snaps with its own offset, picked based on what the player is placing.

<figure><img src="/files/BNr7Sti7FZtXbRFpUmXC" alt="" width="563"><figcaption></figcaption></figure>

### Test & Debug

Make sure the [Building Manager](/easy-build-system/reference/building-manager.md) has the Socket layer correctly assigned in its settings.\
The creation tool puts new sockets on this layer automatically.\
If you copy sockets between projects or change layer settings, check this first.

Place a part with sockets in the scene, enter Play Mode, and bring a matching part close.\
The preview should snap when within the radius.

If nothing snaps, work through these checks in order:

* Check that the socket layer matches what's set on the [Building Manager](/easy-build-system/reference/building-manager.md).
* Check that the snapping point's match type and value are correct.\
  A typo in a Category string is a common culprit.
* The Common Condition's Require Socket flag means the part only places when snapped. Conditions like Collision can still block a snap if the snapped position overlaps geometry.

The **Debug Settings** section controls how the snap radius is rendered in the editor.\
The **Debug Draw Flags** field picks where the gizmos appear.\
Turn on Game View during a playtest to see live where snaps should be triggering.

<figure><img src="/files/0d2ghOsgVPbYNMgXXO63" alt="" width="516"><figcaption></figcaption></figure>

### Practical Examples

**Bidirectional sockets.**\
Add sockets to both parts that need to connect.\
A floor has wall sockets on its edges. A wall has a floor socket on its bottom.\
The player can either drop a wall onto a floor, or place a floor under a wall.\
Both work. Without bidirectional sockets, the connection only works one way.

**Category over Reference**\
Use Category matching by default.\
Fall back to Reference only when you need a specific prefab to be the only valid fit.\
Category matching keeps sockets working as you add new walls, floors, or variants.\
Reference matching breaks the moment you swap one prefab for another.

**Free-standing sockets.**\
Sockets don't have to be children of a [Building Part](/easy-build-system/reference/building-part.md).\
You can drop a [Building Socket](/easy-build-system/reference/building-socket.md) directly into the scene to create predefined snap points.\
Common uses are vehicle attachment slots, named build pads, or NPC equipment mounts.\
The socket still works the same way. Part previews snap to it as if it were attached to another part.


---

# 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://mindcodeinteractive.gitbook.io/easy-build-system/learning/beginner-guides/building-socket-guide.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.
