Npcs not attacking players

This just seems to happen to clients and not host. npc_zombie npcs just stand there and don’t attack players even if they stand right infront of them. They only attack if the player shoots them. Barnicles don’t pick up players if they run quickly through their tongue either, they only do if the player stands there touching the tongue for about 1-2 seconds. No mods used and this is LAN so no net lag. Any idea what’s going on guys? :frowning:


[editline]1st August 2015[/editline]

Please help me, it’s ruining the game mechanics, it’s like some sort of net lag but it’s not because the ping is average about 12 MS. Surely someone has had this before?

not ure about the lua script u use but in mine its like
local zombie = ents.Create( “npc_zombie” )
zombie:SetPos( v )
zombie:SetCustomCollisionCheck( true )
where zombie:Activate() makes them go after the player once spawned

I’ve seen this before while I was looking for a solution but this is making them run to the players before they even see them like the nextbot zombie addon right? I just want them to attack when they see the player right in front of them. They just zone out for ages before they begin attacking unless the host player is nearby. Really weird.

I know it works when you just spawn them on sandbox so why not if they’re baked into the map code by hammer?

do you have info_nodes or info_nodes_hint in the map when you build it in hammer npc’s need them for navigation

Yeah I have tons of info_node_hints and they follow just fine once you’ve finally got their attention

try setting in the zombie settings Wake Radius <float> Auto-wake if player within this distance to a large radius say like 5000

Tried it and still the same with both zombies and barnacles. I just went up to a zombie that was looking away from me, shot it in the back of the head and it turned around and looked at me for less than a second and turned back… It sounded like the wrong ai_relationship to me but I have it setting the relationship to hate like 6 times throughout the map just to be sure lol and still this happens.

[editline]1st August 2015[/editline]

By the way this gives me an error. What is the V in setpos? Is this inside a for loop?