isAmbientPedSphereVisible
Client-side
Runs GTA's camera-frustum sphere test without creating an entity.
Syntax
bool isAmbientPedSphereVisible(Vector3 position, float radius)Arguments
positionVector3Sphere center.
radiusfloatSphere radius.
Returns
true when the sphere is visible to the current GTA camera; false otherwise.
Ownership and lifecycle
Candidate queries create nothing. A multiplayer resource must validate each proposal, create and own the real NPCs and vehicles, assign one current syncer, handle ownership changes, and clean up every element. Native AI and event tokens belong to the calling resource and are revoked when that resource stops.
Important behavior
- The reference population resource uses this as one input to a multi-client spawn veto.
Where this comes from
SOURCECLuaWorldDefs.cppClient/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp INTRODUCED / EXTENDED75dd85f77Read the commit and why the change was made TEST RESOURCE native-ped-traffic test-resources/native-ped-traffic
RELATED SA:O APIS
Read the system guide → Continue exploring
← Back to the SA:O Lua API · How Synchronized NPCs and road traffic works →