Sleepless

Object Gizmo

Configuration

Last updated on

The configuration file is config.lua in the resource root. These values are the defaults for every useGizmo call. A single call can override them. See Call Options.

Config.debug registers /testGizmo. Leave it false on a live server. The command lets any player spawn a prop.

Editor

Config.camera = 'orbit'
Config.mode = 'translate'
Config.space = 'world'
Config.pivot = 'center'
Config.gizmoSize = 0.5
Config.enableScale = false
OptionTypeDefaultDescription
camera'gameplay' | 'orbit''orbit'orbit takes a scripted camera. Drag empty space to orbit, and scroll to zoom. gameplay keeps the player camera. G releases the cursor so they can look.
mode'translate' | 'rotate' | 'scale''translate'Mode when the gizmo opens. scale is ignored unless enableScale is true.
space'world' | 'local''world'world aligns the handles to the world. local aligns them to the entity.
pivot'origin' | 'center''center'center uses the model bounding box and rotates around that point. origin sits on the entity position scripts already save. The returned position is still the entity origin.
gizmoSizenumber0.5Screen-space size of the handles.
enableScalebooleanfalseShows scale mode on S. Scale does not affect collisions and resets once physics run.

Camera Orbit

Used only when the camera mode is orbit.

Config.orbit = {
    minRadius = 1.5,
    maxRadius = 25.0,
    zoomStep = 0.75,
    sensitivity = 0.005,
    blend = 250,
}
OptionTypeDefaultDescription
minRadiusnumber1.5Closest the orbit camera can sit, in metres.
maxRadiusnumber25.0Farthest the orbit camera can sit, in metres.
zoomStepnumber0.75Metres added or removed per scroll step.
sensitivitynumber0.005Mouse drag sensitivity.
blendnumber250Milliseconds to blend into and out of the scripted camera.

Highlight

Objects get an outline. Peds are faded with pedAlpha. SetEntityDrawOutline is not used on a ped.

Config.outlineColor = { r = 255, g = 255, b = 255, a = 255 }
Config.outlineShader = 0
Config.pedAlpha = 200
OptionTypeDefaultDescription
outlineColor{ r, g, b, a }whiteOutline colour. Each channel is 0 to 255.
outlineShadernumber00 is a hard edge. 1 is a softer filled edge.
pedAlphanumber200Ped alpha while the gizmo is open. 0 to 255.

Movement Limits And Physics

Config.freezeEntity = true
Config.freezePlayer = false
Config.disableCollision = false
Config.playerCanMove = false
Config.requestControl = true
OptionTypeDefaultDescription
freezeEntitybooleantrueFreeze the entity while editing, then restore the freeze state it had before.
freezePlayerbooleanfalseFreeze the player ped for the edit.
disableCollisionbooleanfalseTurn entity collision off for the edit, then turn it back on.
playerCanMovebooleanfalseWhen false, movement controls are blocked so W does not walk.
requestControlbooleantrueRequest network control before editing a networked entity.

distanceLimit and bounds are per call. They are not config keys. See Call Options.

Controls

Config.enableCancel = true
Config.snapToGround = true
Config.enableSnapToggle = true
Config.enableCopy = true
Config.snapEnabled = false
Config.translationSnap = 0.25
Config.rotationSnap = 15
Config.scaleSnap = 0.1
OptionTypeDefaultDescription
enableCancelbooleantrueEsc restores the entity to the transform it had when the gizmo opened.
snapToGroundbooleantrueShow the ground-snap control.
enableSnapTogglebooleantrueShow the snap toggle.
enableCopybooleantrueShow the copy control. Copies vec3 position and vec3 rotation.
snapEnabledbooleanfalseStart with snap already on.
translationSnapnumber0.25Snap step in metres while snap is on.
rotationSnapnumber15Snap step in degrees while snap is on.
scaleSnapnumber0.1Scale snap step while snap is on.

HUD

When sleepless_prompts is started and prompts is not false, the controls use a prompt strip. Otherwise they use ox_lib text UI, which also prints the live position and rotation when showCoords is true.

Config.prompts = true
Config.promptPosition = 'bottom-center'
Config.promptLayout = 'row'
Config.textUiPosition = 'right-center'
Config.showCoords = true
OptionTypeDefaultDescription
promptsbooleantrueUse sleepless_prompts when that resource is started. false always uses text UI.
promptPositionstring'bottom-center'Prompt slot. See Prompts.
promptLayout'row' | 'column''row'Prompt layout.
textUiPositionstring'right-center'ox_lib text UI position when prompts are not showing.
showCoordsbooleantrueInclude position and rotation in the text UI. The prompt strip does not repeat these numbers.

Debug

Config.debug = false
OptionTypeDefaultDescription
debugbooleanfalseRegister /testGizmo. Do not enable this on a live server.

On this page