AIPeception: sight and hearing

Hi,
Very interesting course so far (even though I already have quite a bit of UE experience I still learn a lot). I do have a comment for this part though.

By removing the sight functionallity for the second guard, this breaks the whole chasing functionallity and therefore making the “throwing stone” unnessary (because he will anyway not chase)…
So, I think we need to keep both.

Now I noticed that when using the same AIPerception with array of 2 elements, it does not do the trick, because then there is no distinction in which perception is trigger (hearing or sight) and so when throwing the stone, the chasing functionallity is executed.
However when using 2 AIPerceptions with both their functionallity connected to, it seems to work fine.

1 Like

Can you send a screen shot of how you achieved this?

Ok. Actually I created a base class for all my guards, so I can reuse specific functionnality.

Then I derived from this base class for my second guard, adding a second component:

Thanks I also want to have the guards be generic in this aspect

Hmm, if I was to do this from the same BP, so that all the guards would react to both sound and visual cues, how would this be done?


My setup looks like this but only the visual side works. Any ideas?

Hi, I got it to work now with having my base class hearing and sight.
I did experience some issues with it at first as well, reason was that the config for AIPreception hearing was not set to detect friendlies. Once I fixed that, it just worked like this.

Not sure if you are having the same issue, otherwise maybe also check your other settings, like hearing distance etc, because your blueprint code looks fine.

Duh! Of course I forgot to check for friendlies and neutrals lmao, it was even in the video! I’ll test this tomorrow

Now it works! Should have remembered to check that, the audio is bit buggy and won’t always play but the function does

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms