一键导入
roblox-npc-ai
Use when creating Roblox NPCs or enemies with pathfinding, state machines, line-of-sight or FOV detection, spawns, or AI update loops.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating Roblox NPCs or enemies with pathfinding, state machines, line-of-sight or FOV detection, spawns, or AI update loops.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when implementing Roblox character animations, particles, beams, trails, tweens, camera shake, or other visual effects.
Use when building Roblox menus, HUDs, shops, notifications, dialogs, or responsive cross-platform UI.
Use when handling Roblox keyboard, mouse, gamepad, touch, motion input, or cross-platform action binding.
Use when validating RemoteEvent or RemoteFunction arguments, adding rate limits, designing server-authoritative systems, or preventing exploits.
Use when building Roblox vehicles, ragdolls, projectiles, elevators, constraints, forces, or other physics-driven gameplay.
Use when auditing Roblox code for exploit vectors, authority models, remotes, economy, and DataStore flows.
| name | roblox-npc-ai |
| description | Use when creating Roblox NPCs or enemies with pathfinding, state machines, line-of-sight or FOV detection, spawns, or AI update loops. |
| last_reviewed | "2026-07-13T00:00:00.000Z" |
| sources | ["https://raw.githubusercontent.com/Roblox/creator-docs/main/content/en-us/characters/pathfinding.md","https://devforum.roblox.com/t/improving-pathfinding-quality-with-new-algorithm/3258657","https://create.roblox.com/docs/projects/server-authority"] |
Load for NPCs/enemies: pathfinding, state machines, LOS/FOV detection, spawns, AI loops, or physics ownership.
local path = PathfindingService:CreatePath({
AgentRadius = 2, AgentHeight = 5, AgentCanJump = true,
Costs = { Water = 20, DangerZone = math.huge },
})
path:ComputeAsync(npcPos, targetPos)
if path.Status ~= Enum.PathStatus.Success then return end
for _, wp in path:GetWaypoints() do
if wp.Action == Enum.PathWaypointAction.Jump then humanoid.Jump = true end
humanoid:MoveTo(wp.Position)
if not humanoid.MoveToFinished:Wait() then return end
end
Workspace.PathfindingUseImprovedSearch on representative maps before rollout.PathfindingModifier Label → CostsPassThrough = true for doors; PathfindingLink for disconnected navmeshmath.huge cost = non-traversableidle → patrol → chase → attack → flee → dead
(a-b).Magnitude — cheapest, always firstforward:Dot(toTarget) cosine — use a configured cone for the game, not a universal angleworkspace:Raycast — expensive, lastSetNetworkOwner(nil) for physics-sensitive NPCs, but it is not complete security. In Server Authority projects, configure the authority model instead of treating network ownership as the security boundary.For spawners, lifecycle cleanup, timeout handling, and performance budgets, load references/full.md.