Setting a blackboardkey from a actor?

Hello there,

I have the following situation: I have an enemycharacter which has a sensingcomponent, It has an event for hearing and seeing the player. Now I want to set in his blackboard the key TargetActor to the actor he saw/heard (Player), how do I do this?

Thanks

Hey . Try: Get Blackboard > set value as (type) > reference your desired key by name and set its value. Can’t post a screenshot atm but this post should help.

Okay, I tried it, but I don’t know if it works yet, this should work right?

It doesn’t seem to set the value to the value I want, this is what I have going right now

Here’s an example of mine. I use this method to setup a customisable patrol sequence for individual instances of the npc.

From what I can see (I’m no elite), you’re setup alright for the key to update.
Can you confirm a few things -
Are you getting any value at all?
Is the event actually firing?
Is your function in your characters controller blueprint?

I notice you’re casting to your First person character for the reference though your event appears to pass the pawn reference anyway?

I know what I did wrong, I used the wrong keyname, I used Enemy_State (enum name) instead of State (Key Name)

It is not in my AI controller, I don’t know if I can use the event on hear noise and on see pawn in there, the debugs strings tell me everything is working fine now, I made some new changes anyway. And the casting is to make sure if the noise/pawn is from the player.