AIPerception last sensed stimuli suddenly swappedposition

Hi,
So I dont know exactly what is the cause of this but for some reason the AIPerception get actors perception which contains the stimuli information for an actor is now returning an array with different positions for the senses.
It used to be that when looping over the array 0 was sight and 1 was hearing. These have switched to 0 is hearing and 1 is sight.
I don’t know why exactly.
Im thinking it might be because I set autoregister for the ai sense sight to false awhile ago but ive done the same with hearing now and still for some reason the positions are swapped. The solution is to change a few links around in my bp’s but id like to know what caused it.
Thanks for yuor time

I am running into this exact same issue… Took forever to track down. I have an AI with 4 Stimuli, and under different conditions, Hearing will be in different spots in the array. It is authored at Array Position 1, but can show up in 2 under certain circumstances.

A quick fix that worked for me ( but have zero idea why…), was to place one of the AI in the level manually, rather than rely on them all being spawned in dynamically. Funnily enough, just spawning 1 in manually fixes all the dynamically spawned ones.

I hate using things that rely on something being in a particularly numbered array entry. This should 100% be a map, or at least the FAIStimulus Struct should expose the Type member to blueprint so we can just iterate through them all and see which one is which.

May be too late for you, but I found a solution for this on the UDN.

There is a blueprint node called “Get Sense Class for Stimulus”, which will return which type of Stimulus class a particular Stimulus is. You can then use that to iterate through all Stimulii and find the one you want. They seem to be aware of this issue.

Best of luck!