Skip to main content

NPCHandle (client)

On the client, an NPCHandle also reads the NPC's bounding box in the local player's game.

Available on: Client

See also: NPCHandle, NPCHandle (server)

Methods​

npc:GetAABB()​

Returns the NPC's bounding box in world space.

Side: Client

Parameters: none

Returns: AABB (with min and max vec3s, see Math), or nil while the NPC is not spawned in this game.

Example

local box = npc:GetAABB()

if box then
local top = box.max.y
end

npc:GetLocalAABB()​

Returns the NPC's bounding box in its own model space (not moved or turned with the NPC).

Side: Client

Parameters: none

Returns: AABB, or nil while the NPC is not spawned in this game.

Example

local box = npc:GetLocalAABB()

if box then
local height = box.max.y - box.min.y
end