Encountering an issue with setting a BlackboardKey

Below is a screenshot of what the blueprints currently look like.
For some reason the branch is running a second time right away after passing a true result and returning a false and it unsets the blackboard key. Sight is the only perception set.

It is supposed to not be returning false until after the player leaves the perception range and I do not understand why it is running again right away. I built this same exact set up in a fresh project after this issue started and it is working as intended in the fresh project.

Hey @Zeryphim!

It looks like the problem here might lie in the process before the setting but due to the process of updating the perception.

This event occurs whenever something labeled as “Should be perceived” either STARTS being perceived or STOPS being perceived. Therefore, my first thought would be: If it is running more than once, is there more than one thing in the environment that can be perceived?

Check that out and get back to us!

(post deleted by author)

I am not seeing anything that indicates another actor is being picked up by the sense.

Maybe run it through a printstring between the ForEach and the Get Actor Perception with an input of the array element to check? Then it will print the name of anything that is perceived (and stopped being perceived) when it changes. This way we can prove if it’s getting noticed twice, if it’s two separate things, or it’s getting noticed only once and for some reason firing twice(unlikely as the logic doesn’t work).

I set the print string where you stated and it’s only returning BP_Warrior which is the player character currently set.

I have another one set that was printing the True and False from the Successfully Sensed just before the Branch and I caught it was not returning False immediately after True.

I popped open the AI debug menu and now it is retaining the Key value from the True until I leave the sight range as it was supposed to be doing. I have made no changes since My last response, but I did shut down my project for about two hours to take a break and have dinner. That seems to have fixed whatever was causing the issue.