So I want to create an incapacitated state for my NPCs that I will later on expand to be either dead, paniced or incapacitated. But for now they are just dead when they become incapacitated.
But I want to disable their perception when they go into any of the incpacitated steps, and so far I haven’t managed. Right now the NPCs react to other NPCs around them, turning towards them while in the incapacitated state.
This is the current blueprint line I run to see if they have become incpacitated.
Notice that the “Detache from controller…” node isn’t attached. While it solves the problem with the turning, it also cuts off the NPC from its blackboard, causing a lot of other issues.
What other options do I have to turn off or limit the perception? I don’t really want to go into C++ as I have no idea how to do that.
No the behavior tree only triggers when a Blackboard value has been changed. And that value is set when the AI controller runs an “On target perception updated (AIPerception)”
And I notice now that I don’t do a check on the perception update to see if “Self” is incapacitated. But that seem like a rather dirty fix to it as the perception tick would still run.
EDIT: Yes, adding a branch checking if “self” is incpacitated on the “On target perception updated (AIPerception)” solved the issue with the spinning corpses. But it doesn’t feel like the optimal solution.