Hey all, so first what I’m trying to accomplish, is that given a scenario where my AI is in the process of attacking a player, I want it to first check that the player it’s attacking is still alive before proceeding with the next attack, I do this by calling a service before the attack branch which attempts to retrieve a boolean from the player character ‘IsAlive’, then using that value to set a local blackboard key which is used as a decorator on the attack branch.
The issue, is that I can’t get it to get the player characters IsAlive property and assign it to the blackboard key. What I’ve tried so far is 3 different approaches, firstly I’ve tried having a reference to the player character object which is working correctly, as I can see in the visualizer it’s correctly assigning the object type key to the target:
And this is the service using the first method of just casting to the player character:
But as mentioned, that didn’t work, so I tried a second method of setting a reference to the player character in my AI Controller, then casting to the AI controller in the service and from there accessing the player character reference and its IsAlive property:
Again no luck with this one, so I’ve also tried another method of using an interface, and passing a reference to the local blackboard through an interface message to the character, where the character can then use the reference to set the blackboard key from its side:
And on the player character side:
I’m out of ideas at this point, what am I doing wrong?