SetAiNavigationBlockerEnabled
setAiNavigationBlockerEnabled
AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.
Enables or disables a resource-owned navigation blocker without deleting it.
Syntax
bool setAiNavigationBlockerEnabled(string blockerId, bool enabled)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
blockerId |
string |
yes | The opaque decimal identifier returned by createAiNavigationBlocker. Keep it as a string.
|
enabled |
bool |
yes | True to activate the blocker or false to leave it stored but ignored by movement queries. |
Returns
Returns true for a valid owned blocker, including an idempotent request; otherwise returns false.
Examples
Open and close a scripted gate for AI:
setAiNavigationBlockerEnabled(gateBlockerId, gateIsClosed)
Notes
- Available only in server-side resource scripts.
- Enabled-state changes are applied to subsequent movement checks. Enabling revalidates affected paths; disabling wakes affected blocked paths.
- A disabled blocker remains visible through the owner-only getter and list functions.
- Toggle occasional world states such as doors and gates; per-tick blocker animation is unsupported.