Skip to main content
Everything on this page is a client export on 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 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 any add* export
Example:
An alias of remove - identical behavior, kept so code written against point-specific naming reads naturally. It accepts any anchor or rule id, not just points.
Parameters:
  • id (number) - The id returned by any add* export
Removes an entity anchor by the id addEntity returned.
Parameters:
  • id (number) - The id returned by addEntity
Example:
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 in Config.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.
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
Example:
Release a tag you previously held with 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.
Parameters:
  • tag (string) - The same tag passed to suppress
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) - true while the layer is asleep
Example:

Debugging

Every 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.
Leave debug off in production - it exists for placing and sizing anchors during development.
Zones registered through the compatibility layers honor their original debug / debugPoly fields the same way, so bridged debug zones draw their volume too.