lation_interact: removal of anchors and rules, tag-based suppression of the whole layer, and the per-anchor debug flag.
Removing Anchors
Cleanup is largely automatic: every anchor and rule a resource registered is dropped when that resource stops, and entity anchors remove themselves when their entity stops existing. Manual removal is for anchors that should disappear mid-session.
remove
remove
Remove any anchor or rule by id, whatever its kind - points, sphere/box zones, entity anchors, model rules, and global rules all share one id space. Calling it with an id that no longer exists is a safe no-op.Parameters:
id(number) - The id returned by anyadd*export
removePoint
removePoint
An alias of Parameters:
remove - identical behavior, kept so code written against point-specific naming reads naturally. It accepts any anchor or rule id, not just points.id(number) - The id returned by anyadd*export
removeEntity
removeEntity
Removes an entity anchor by the id Parameters:
addEntity returned.id(number) - The id returned byaddEntity
This export name is shared with the ox_target compatibility layer, and it handles both call shapes. A known lation_interact anchor id passed alone removes that anchor. Anything else - a netId or array of netIds, optionally followed by option names - is treated as ox_target’s
removeEntity(netIds, optionNames) and removes options registered through the ox bridge. The two can never collide: anchor ids are allocated starting above 1,000,000, far past FiveM’s 16-bit network id space.Suppression
When the layer is suppressed, everything sleeps - no grains, no focus, no pill, no input - and it wakes the moment the state clears. Suppression happens automatically for the states enabled inConfig.Suppress (dead, cuffed, the pause menu, another resource holding NUI focus), and any script can hold the layer down manually with its own tag. Tags are independent: two scripts never fight over one boolean, and a tag is held until its owner releases it.
suppress
suppress
Hold the interaction layer down under a tag. The layer stays asleep until the same tag is released - use a tag unique to your script so you never collide with another script’s hold.Parameters:
tag(string) - A non-empty identifier for your hold, e.g. your resource name
release
release
Release a tag you previously held with Parameters:
suppress. The layer wakes once no manual tags are held and no automatic suppression state is active. Releasing a tag that was never held is a safe no-op.tag(string) - The same tag passed tosuppress
isSuppressed
isSuppressed
Returns whether the layer is currently suppressed for any reason - a manual tag or an automatic state (dead, cuffed, pause menu, NUI focus). Suppression is evaluated on a slow interval, never per frame, so the answer reflects the most recent pass.Returns:
suppressed(boolean) -truewhile the layer is asleep
Debugging
The debug flag
The debug flag
Every Zones registered through the compatibility layers honor their original
add* spec accepts debug = true, which draws the anchor’s physical interaction shape in-world: zones draw their volume (the sphere or rotated box), while points and entity anchors draw the reach sphere at the anchor. Point and zone shapes draw at any distance while the flag is set, so you can line placements up from across the map; entity shapes draw whenever their entity is around.debug / debugPoly fields the same way, so bridged debug zones draw their volume too.