The issue is when I try to cast to a controller in one of the tasks, the cast always fails. I want the AI not to only face the player character but who ever hurts him. I’ve tried several work arounds but each one does’t obtain the desired effect. If I could get the AI to do as in the video, I’d be happy.
Do you have a screenshot of the blueprint where you are actually setting the instigator? Take in mind that one thing is the Damage instigator and other is the Instigator of an actor (by the look of your screenshot it looks like you are getting the instigator of the bot itself, thats why im asking).
You should set the instigator in your blackboard data asset everytime a player or another actor hurts the bot.
Just Cast to your Player Character e.g Cast to ThirdPersonPlayerCharacter (Depending upon your character BP name), in object input add “Get Player Character” node. The output of casting to your character can be directly used as input in “New Focus”
Here is the screenshot of the damage system in the bot character blueprint in which I set the damage insigator to the instigating object. In the other screenshot I have the “random move to location” task where I set the blackboard key values. Hope this is what you where asking for.
I just tried that and got better results, but the bot still isn’t setting the damage instigator as “focus.” In the “Event Any Damage” I cast to the controller. What is that you made your cast to?
That seems similar, but the focus still doesn’t operate properly. However casting to the AI Controller causes the bot to face where the damage delivering shot came from. The Focus fails to work when I set the “New Focus” to a controller. I’ll attempt setting focus in the “Event Any Damage.”
Do you know of any other methods that would get the same result? Perhaps this isn’t the best way with the focus acting up.