I’m trying to create a system where the enemy character doesn’t do anything until you’ve annoyed it enough; like The Witch from Left 4 Dead. It’s proving quite a bit more difficult than I thought.
I have a single task at the top of the behavior tree. First there’s a dot product to make sure the enemy only receives damage when both the player and the enemy are facing each other. Next I have a line trace going from the player to the enemy, so that the enemy only receives damage when there is line of sight. Each line trace reduces a health variable, when it reaches zero, the BT Task is a success and the enemy character starts chasing the player.
However I’m having a few issues:
-
I can’t call an Event Point Damage node in a BT Task, but I can call it in the Character BP. I originally tried to set this up just using the Character BP but I figured it might be too difficult so I set up an AI system instead. I have no idea how I’m going to set an Integer variable in the BT Task that can be altered by interactions from the player character; I’m not even sure if this is the right way to do things.
-
I haven’t even started trying to implement audio cues from the player to the enemy. I have no idea how I would be able to do this in the same BT Task.