AI Perception - Event Tick Retreiving AI Stimulus Issue

Hi all,

So first let me explain what I’m trying to do. I’m trying to get AIStimulus information from an AIPerception component. More specifically I’m trying to get the other variables such as age, strength, stimlus location, etc… to create an AI that’s a bit more intelligent than something that just chases the player around. I wanted to keep track of a player regardless of whether or not they were successfully sensed by the Age of the last stimulus.

After a bit of testing I came to the conclusion that Perception Events don’t fire off unless:
A. A Stimulus is perceived
B. A Stimulus is un-perceived

So, what about when I’m perceiving an actor, and I want to grab the Stimulus data when these events aren’t firing off? Seems like the best option is to get it from one of the many Perception Functions, maybe Get Actors Perception.

While I didn’t like the idea of something continuously polling for data I figured the best option to was to use it the On Tick Event (I can feel the more experienced dev’s cringing right now), but it worked, sort of…

Age was continuously bouncing between 3E20+ something and 0 even though the actor was constantly being perceived. I realized almost right away I had to have been doing this the unintended way. Surely I was trying to retrieve a value that was being written to memory while I was accessing it, right?- So this is where you come in kind community forum person. Enlighten me, hell insult me, but share your wisdom onto me and others who find this question in the near and later future.

Here’s a video showing the behavior when attempting to retrieve Age from AIStimulus, you’ll see the value of age bounces between some obscene large number, back to 0 (the expected value)

Thanks.