I've looked but havn't been able to find a the workflow for this searching online.
I have an NPC, with a behavior tree. Right now it just moves around the map. It's supposed to have a health variable, which triggers something to happen when its health is at 0. 'Health' is reduced when the player shoots a ray cast at it.
I'm unable to find where/how to place this.
I've tried storing the 'health' in the Character, the Controller, and in a Blackboard.
Storing it in the Blackboard allows the behavior tree 'Tasks' to modify it, but then it can't be triggered to change by an 'On Any Damage' in the NPC Character/Controller. I can put it in the Character, but then the tree or its tasks can't seem to access it.
Sorry if this is vague, I'm lost. This feels like it should be simple.
TLDR, all I need is a variable stored in the NPC Character which the behaviour tree or its tasks can react to. Simple, no? Can't figure out how personally.