World editor
- Added
- Updated
The editor runs as a session. A calling resource supplies the entities to edit, the allowed actions, and the format expected for the result.
Targets can be objects, peds, vehicles, existing client entity handles, or particle markers.
The returned record keeps the caller's key, label, group, and data, and adds the final transform and a status of unchanged, moved, added, or removed.
| Key | Action |
|---|---|
LMB click | Select under the pointer; empty space deselects |
LMB drag | Turn the view, unless dragging the gizmo |
W A S D | Fly; in edit mode, only while turning the view |
Q / E | Move down/up while turning the view or with no selection |
Shift | Fly faster |
| Mouse wheel | Change camera speed or placement distance |
E / Q | Enter/leave selection edit mode |
RMB click | Edit the target in translation mode |
W / E / L | Translation/rotation/local axes while editing |
P | Pick up the selection for aim placement |
LMB / E / Q | Drop/drop/restore the held entity |
| Arrow keys | Rotate while placing; Shift uses a larger step |
X | Toggle surface snapping |
G | Place on the surface below, preserving rotation |
F | Focus the camera on the selection |
LCtrl + C / V | Copy/paste |
LCtrl + Z / Y | Undo/redo a transform |
Del | Delete the selection |
Enter | Return session results; standalone copies vector4 |
Backspace | Exit, asking for confirmation while the scene has entities |
Opening a client session
openEditorAndWait waits until the player saves or closes the editor.
local result = exports.REC_WorldManager:openEditorAndWait({
label = "REC_YachtHeist / yacht-1",
targets = myEntities,
format = {
fields = { "type", "model", "coords", "heading", },
typePrefix = "entityTypes.",
precision = 2,
},
permissions = { spawn = true, delete = true, transform = true, select = false, },
})
if result ~= nil and result.saved == true then
print(result.text)
end
Opening a server session
Server-side callbacks stay in the calling resource while the serializable request crosses the network.
onSave and onClose receive the player ID before the result.
exports.REC_WorldManager:openEditorFor(src, {
label = "yacht-1",
targets = svCfg.locations["yacht-1"].entities,
format = { typePrefix = "entityTypes.", precision = 2, },
onSave = function (playerId, result)
svCfg.locations["yacht-1"].entities = result.records
end,
})
Set permissions.select = false when the player must only edit the supplied targets.
Set teleport = false when the player must remain in place, although distant targets may not stream correctly.
Closing and sharing a scene
Use the top toolbar, the scene/model catalog on the left and the selection panel on the right. The pointer automatically operates panels when over them and the world elsewhere; TAB focus switching is no longer needed. The catalog supports objects, peds and vehicles.
Closing removes spawned entities by default and restores existing world entities. Set config.editor.keepSpawned for standalone /worldeditor, or request.keepEntities for a caller-owned session, to retain spawned entities. Changes and deletions to the session’s own handle targets are committed only when saved.
config.editor.session.confirmExit controls the exit confirmation when the scene contains entities. closeEditor and server-forced closes do not ask.
The Share button offers nobody, nearby players or selected players. Nearby sharing uses the same routing bucket and defaults to 50 m from an entity. Shared local copies disappear when sharing stops or the editor closes. Existing networked entities are not replicated this way. Sharing requires the editor ACE; configure it through config.editor.share.enabled and radius.
Placement without the editor
startPlacementAndWait lets an entity follow the gameplay camera’s aim and returns its placement. It cannot run at the same time as the editor.
local result = exports.REC_WorldManager:startPlacementAndWait({
model = "prop_cctv_cam_01a",
surface = "wall",
alignToSurface = true,
reach = 6.0,
})
if result ~= nil and result.confirmed == true then
print(result.spot.coords, result.spot.rotation)
end
E or left click places, left/right arrows rotate, X toggles surface snapping and Backspace cancels. Use items for a sequence; Enter finishes early after minCount is met. Defaults live in config.placement.
Use surface, reach, area and validate for placement restrictions. Previews are removed on completion by default: spawn persistent/networked entities from the confirmed spots in the calling resource. keepEntities = true retains client previews, which still disappear on resource restart.
Server callers use startPlacementFor / startPlacementForAndWait. The server revalidates positions and restrictions and returns reason = "rejected" for invalid results.
