Skip to main content
Bridge.Target is a normalized targeting API. You register interactions on entities, models, or world zones with a single option shape, and the bridge dispatches to whatever targeting resource is running — ox_target, qb-target, or, with neither installed, its own Interact prompts. Your call site stays the same across all three.

Availability

Client only.
local id = Bridge.Target.AddBoxZone(opts)
local id = Bridge.Target.AddSphereZone(opts)
local id = Bridge.Target.AddEntity(entity, options)
local id = Bridge.Target.AddModel(models, options)
Bridge.Target.Remove(id)

Provider selection

Target reads its own convar — atlas:target, not atlas:ui:target.
setr atlas:target "auto"   # auto | ox | qb | own | custom
ValueRenderer
auto (default)ox_target started → ox; else qb-target started → qb; else own.
oxox_target.
qbqb-target.
ownThe bridge’s own Interact prompts.
customYour own resource — fill editable/target.lua.
The bridge’s own target maps each zone/entity to a single Interact prompt, so it uses only the first option you pass, and AddModel is a no-op (native Interact cannot target by model). For multi-option targets or model targeting, run ox_target or qb-target.

Option shape

Every Add* call takes a list of options with this normalized shape:
options[].label
string
required
The interaction label shown on the eye/prompt.
options[].icon
string
An icon for the option.
options[].distance
number
default:"2.0"
Max interaction distance.
options[].canInteract
function
fun(entity): boolean — return false to hide the option dynamically.
options[].onSelect
function
required
fun(entity) — called when the option is chosen. Receives the targeted entity (for AddEntity / AddModel).

Methods

AddBoxZone

coords
vector3
required
Center of the box.
size
vector3
default:"vec3(2,2,2)"
Box dimensions.
heading
number
default:"0.0"
Box rotation (honored by ox_target / qb-target).
options
table[]
required
The interaction options.

AddSphereZone

coords
vector3
required
Center of the sphere.
radius
number
default:"2.0"
Sphere radius.
options
table[]
required
The interaction options.

AddEntity / AddModel

entity
number
For AddEntity — the entity handle to attach options to.
models
string | string[]
For AddModel — one or more model names (ox_target / qb-target only).
options
table[]
required
The interaction options.

Remove

Bridge.Target.Remove(id) — removes a zone/entity registration by the id returned from any Add* call.

Examples

local id = Bridge.Target.AddBoxZone({
    coords = vec3(25.7, -1347.3, 29.5),
    size = vec3(2.0, 2.0, 2.0),
    heading = 0.0,
    options = {
        { label = 'Rob register', icon = 'cash', distance = 1.5,
          canInteract = function() return canRob end,
          onSelect = function(entity) rob() end },
    },
})
-- …later
Bridge.Target.Remove(id)
When it falls back to the bridge’s own Interact, the prompt tints to the player’s theme accent like every other component. Install ox_target for the richest experience (multi-option, model targeting, box rotation).