Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 963 Bytes

File metadata and controls

14 lines (11 loc) · 963 Bytes

CS2-npc

This script enables smart NPC movement in Counter-Strike 2 using a dynamic navmesh. NPCs (spawned from a point_template) use a navmesh generated at runtime—seeded from an info_target named npc_walkable—to pathfind to player pings.

  • Ramp Preference: NPCs prefer ramps and smooth inclines, but can climb ledges if no ramp is available.
  • Edge & Drop Avoidance: Pathfinding cost increases near map edges and drop-offs, so NPCs avoid dangerous areas.
  • Seeded Navmesh: Only areas connected to the npc_walkable seed are walkable.
  • Debug & Control: Use chat commands:
    • generate_navmesh — Build navmesh
    • navmesh_debug — Visualize navmesh for 10 seconds
    • reset — Reset NPC and navmesh
  • Configurable: All movement and navmesh parameters are easily adjustable in the script.

Place a point_template with a prop_dynamic named npc and an info_target named npc_walkable in your map to get started.