Player object not being set in Behavior Tree

Hi,
So I have three instances of goblins running around that run either from or to the player depending on some conditions. I have a rotate-to-face bb entry in their behavior tree and for two of the goblins, it works from what I’ve seen 100% of the time, and maybe 10% of the time for the 3rd goblin. They’re all running the same tree, just different instances of it so I’m confused why it doesn’t work for goblin #3.

Hi, how do you get player actor reference?

@lordlolek
I didn’t do anything outside of referencing the key and setting the base class. I would’ve used a task to find the player but it worked fine for two instances of the goblins.

You didn’t really answer the question. How do you get the player actor reference to set the key if not through a task? AI perception? Giving us a detailed explanation of how you get this reference lies at the heart of whatever issue you’re having. Maybe attach some screenshots of that process :slight_smile:

It looks like you are not really setting the player actor reference key in the blackboard of the behavior tree. therefor how does the AI know where to rotate towards? How you could do it for instance is within your AICharacter preform preform this piece of code: