Socket Editor
The socket editor changes the sockets of a prefab: add new ones, move or turn them, and delete them. A change applies to every copy of that prefab.
Edit a prefab's sockets
Sockets must be shown: while they are hidden, the Sockets panel says so, and you cannot click sockets in the scene.
- Turn on the Show sockets button on the transform widget.
- Select one prefab.
- In the Sockets panel of the Inspector, click Edit Sockets. The socket editor opens. The selection is locked, and the move and rotate gizmo now works on the active socket.
- Click a socket in the scene to pick it, or click Add Socket to add one in the middle of the prefab.
- Move and turn the socket with the gizmo, or type its Position and Rotation.
- Set its Name, Type and Roll Step if you need to.
- Click Save.
- Click Stop Editing, or press Esc.
A prefab without sockets has no Sockets panel. To give it sockets, click the ⋮ button on the name row at the top of the Inspector, then click Add Sockets. The socket editor opens.
The socket editor has no undo. Revert reads the edited prefab's sockets from the socket files again: its unsaved changes are lost, and other prefabs keep theirs. If you close the editor without saving, the changes stay until you reload the socket files or restart RustEdit, and they are then lost.
Socket editor fields
| Field | What it does |
|---|---|
| Name | The socket's name. Links find their socket by name. |
| Type | Sockets connect when their types allow it. The default type connects to everything. |
| Position | Position in the prefab's space. |
| Rotation | Rotation in the prefab's space. The socket's forward axis points out of the prefab. |
| Roll Step | Above 0, the socket can join at every multiple of this many degrees around its forward axis. 0 to 180. |
| Add Socket | Adds a socket in the middle of the prefab. |
| Delete Socket | Deletes the active socket and its links. |
| Save | Writes this prefab's sockets to its socket file. |
| Revert | Reads this prefab's sockets from the socket files again. Its unsaved socket changes are lost. Other prefabs keep theirs. |
Socket files
Socket definitions are JSON files in the Configuration/sockets folder next to the app.
default.jsonholds the built-in sockets. RustEdit replaces it when a new version has newer built-in sockets, and keeps the old one asdefault.json.bak. Do not edit it.- The socket editor saves your changes to
custom.json(or to the file the prefab's sockets came from, when that is notdefault.json). - Other
.jsonfiles load afterdefault.json, in name order. A later file replaces a prefab's whole socket list.
After you edit a socket file by hand, click . The Notifications panel says how many prefabs and sockets were loaded.
A socket file looks like this:
{
"version": 1,
"types": {
"pipe": { "color": "1 0.5 0 1", "connects": [ "pipe" ] }
},
"prefabs": {
"assets/bundled/prefabs/example/pipe_straight.prefab": [
{ "name": "front", "type": "pipe", "position": "0 0 4", "rotation": "0 0 0", "rollStep": 90 },
{ "name": "back", "type": "pipe", "position": "0 0 -4", "rotation": "0 180 0", "rollStep": 90 }
]
}
}
types: each type has acolor(red, green, blue and opacity, 0 to 1) and the types itconnectsto."*"connects to every type. Two sockets can join when either type lists the other. The built-indefaulttype connects to everything.prefabs: the full prefab path, then its sockets.typecan be left out (it is thendefault), and so canrollStep(0).- Numbers in
position,rotationandcolorare written with spaces between them, and with a dot as the decimal mark on every computer. A file written with decimal commas by an older version still reads.